Android studio, configure gradle project takes forever

前端 未结 9 2233
滥情空心
滥情空心 2020-12-14 01:06

After changing the gradle build file to use gradle build tool 0.8.+,

classpath \'com.android.tools.build:gradle:0.8.+\'

my Android studio

相关标签:
9条回答
  • 2020-12-14 01:27

    What worked for me in this regard was , replacing the GRDADLE jar and properties file from the respective project that you may be trying to import .

    1. Build a project fresh or , copy the gradle jar and properties file from the working project
    2. Now , further copy these files and replace with the "Originaly" not working gradle files of the project you are trying to import or the project where gradle build hangs

    Bit late , but can be of some help to the future queries .

    0 讨论(0)
  • 2020-12-14 01:29

    If anyone face this sync stuck problem in mac, give this a try.

    right click your

    android studio.app -> show package -> content -> gradle

    and see the gradle version. In that folder, now got to your android studio IDE and open your preference and go to

    Build, execution -> build tool - > gradle

    check the preference there. verify the path of gradle is as content - > .... and last there will be gradle version, see if that matched the gradle version in the content of androidStudio.app

    guess this helps someone.

    0 讨论(0)
  • 2020-12-14 01:30

    This could be anything, but in my case, it is due to an invalid HTTP proxy and some libraries can't be downloaded. In Settings-> HTTP Proxy, set to "None".

    0 讨论(0)
  • 2020-12-14 01:30

    delete gradle folder in your project folder then reopen it using studio, in choose dialog choose cancel, don't use grade wrapper to download latest version of gradle

    0 讨论(0)
  • 2020-12-14 01:37

    I solved it

    • deleting gradle and intellij files

      rm -rf .idea/ *.iml .gradle/
      
    • reimporting the project on intellij

    • choosing same jdk for gradle that you use on gradle terminal(makes sense if you use daemon)
    • and upgrading from gradle 2.4 to 2.13
    0 讨论(0)
  • 2020-12-14 01:37

    In my case the problem was Genymotion plugin.
    Once i removed it from studio and restarted. It worked fine.

    I still don't know how that could happen as i regularly use genymotion with studio in my other machines.

    You can still run genymotion even if you remove studio plugin by starting emulator from genymotion itself.

    0 讨论(0)
提交回复
热议问题