Android Studio stuck on “Gradle: resolve dependencies '_debugCompile'” or 'detachedConfiguration1'

后端 未结 10 819
萌比男神i
萌比男神i 2020-11-27 04:20

I have no idea what I changed in my project, but it suddenly cannot get past this step while building gradle scripts.

There is no problem building it with j

相关标签:
10条回答
  • 2020-11-27 05:21

    I encountered the same issue and resolved it by adding both http and https proxies in the gradle.properties file. It is important to add the https proxy as the gradle-2.10-all.zip is read using https:

    https://services.gradle.org/distributions/gradle-2.10-all.zip

    gradle.properties:

    systemProp.http.proxyHost=<http proxy name>
    systemProp.http.proxyPort=<http proxy port>
    systemProp.https.proxyHost=<https proxy name>
    systemProp.https.proxyPort=<https proxy port>
    
    0 讨论(0)
  • 2020-11-27 05:25

    Please run gradle from command line (opening a terminal in your project folder) using -info and check where it stop. I was experiencing something similar and it was related with jcenter(), because it can't reach a resource:

    Resource missing. HTTP GET

    so, changing jcenter() by mavenCentral() in MyProject/build.gradle did the trick.

    I hope it can help.

    0 讨论(0)
  • 2020-11-27 05:26

    On the Debian,

    I have the same problem, fixed for me with two changes,

    First enable proxy for gradle on the gradle.properties file, both for http and https:

    systemProp.http.proxyHost=127.0.0.1
    systemProp.http.proxyPort=8080
    systemProp.https.proxyHost=127.0.0.1
    systemProp.https.proxyPort=8080
    

    And then next by installing lib32stdc++6 and lib32z1 packages:

    $ sudo apt-get install lib32stdc++6 lib32z1
    

    I discover my problem with enabling debug and info option for gradlw command, that I run it on the root of project:

    First with this command:

    ./gradlew --info --debug 
    

    And next with this command:

    ./gradlew --info --debug :app:generateDebugSources
    

    Output debug (On Android Gui this section run again and agian on the background without you know about error message ):

    23:25:45.419 [ERROR] [system.err] Exception in thread "png-cruncher_10" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /local/path/to/Android/sdk/build-tools/22.0.1/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    23:25:45.419 [ERROR] [system.err]   at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    23:25:45.419 [ERROR] [system.err]   at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    23:25:45.419 [ERROR] [system.err]   at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    23:25:45.419 [ERROR] [system.err]   at java.lang.Thread.run(Thread.java:745)
    
    0 讨论(0)
  • 2020-11-27 05:27

    It turns out that this line:

    repositories {     
      maven {     
        url 'http://ksoap2-android.googlecode.com/svn/m2-repo'    
      }
    

    is solely responsible for forever-stuck Android studio. Probably the repository is not active/offline today...

    Interesting questions:

    1. How come the gradle scripts work just fine in Terminal? (though it seemed slower than usual).

    2. How come THERE IS NO TIMEOUT for that? It surely created a few white hairs today.. ;)

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