Gradle gets stuck at either 'build' or 'assembleDebug' when using the 64bit or 32bit version of Android Studio

前端 未结 7 1589
夕颜
夕颜 2021-01-04 06:33

The issue I\'ve had over the past few months is that Android Studio would often get stuck on Gradle: build, as seen here. Android Studio itself would stay respo

相关标签:
7条回答
  • 2021-01-04 07:00

    Because there is no answer to this problem I will share, what I have done, to solve this issue. From what I have seen, the problem is that there is a dependancy(or many) from a maven repo that can not be loaded. So you have to take all dependacy one by one and check if exist on the maven repo.

    For example I was having a dependancy for "org.jraf:android-switch-backport:1.3.1" from "http://JRAF.org/static/maven/2" that at that time could not be opened.

    My build.gradle looked like this:

      repositories {
          mavenCentral()
          maven {
            url "http://JRAF.org/static/maven/2"
          }
      }
    
      compile "org.jraf:android-switch-backport:1.3.1
    
    0 讨论(0)
  • 2021-01-04 07:03

    For me, this problem occurred when I was USB tethering using an Android device. The first build took anywhere from 5-10 minutes, and every subsequent build took about 3-7 seconds. I found that by disabling USB tethering, the first build completed quickly (and so would all subsequent builds). After the first build completed, I could reenable USB tethering.

    0 讨论(0)
  • 2021-01-04 07:08

    My problem was that the Android Sdk executables were missing the executable bit. You can check some of your binaries like /Sdk/build-tools//aapt to see if they have permission to execute. If not you can solve it by running this on the Sdk folder

    chmod -R +x ./
    
    0 讨论(0)
  • 2021-01-04 07:09

    If you are behind a proxy on ubunthu you might need to set your gradle system wide proxy:

    sudo nano ~/.gradle/gradle.properties 
    

    And enter the following entries:

    systemProp.http.proxyHost=<Your Host>
    systemProp.http.proxyPort=<Your Host Port>
    
    0 讨论(0)
  • 2021-01-04 07:12

    If you have a fresh Ubuntu 14.04 with Android Studio 1.5, you may be missing a library. Try this:

    sudo apt-get install lib32z1
    

    Another stack overflow answer

    0 讨论(0)
  • 2021-01-04 07:14

    I was experiencing the same problem, and the solution was very unexpected in my case: AVAST antivirus was somehow interfering with the Gradle:build process. Deactivating this antivirus solved the problem!

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