简体   繁体   中英

Gradle build hangs after update to Android Studio 1.3

I've just updated to Android Studio 1.3, opened an existing project I was working on, tried to run it. Gradle just gets stuck at the "Resolve dependencies':app_debugCompile'", I tried to wait, I waited for over an hour and nothing happened.

How can I solve it to get my app running?

If you are using proxy, it seems https proxy server setting is not correctly done in Android studio 1.3. You can set https proxy server manually in gradle.properties,

systemProp.https.proxyHost=proxy.server.address
systemProp.https.proxyPort=8080

see Gradle Sync fails in Android studio 1.3 and gradle behind proxy in Android Studio 1.3 .

How can I solve it to get my app running?

Start by identifying the problem more precisely. To do so, run gradle from the command line in the root directory of your project :

./gradlew --debug clean build

The --debug argument will simply enable the debug log level and hopefully providing useful information to understand where/why it is hanging.

我在linux中遇到这个问题,在Fedora上安装这些依赖项后问题解决了:

sudo dnf install glibc.i686 zlib.i686 libstdc++-devel.i686 

I had this problem.Just see this page. Solution is here

Solution :

  1. Make sure you have latest stable version ( current 2.0.0 )
  2. Make sure your gradle version is 2.0.0 in build.gradle ( classpath 'com.android.tools.build:gradle:2.0.0')
  3. Final step and most important one is change your jcenter() to mavenCentral()

So you can easily add new dependency and sync project under 3sec !

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenCentral()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

转到应用>右键单击>打开模块设置>将构建工具版本更改为22.0.1重新启动Android Studio后再试一次

I've just encountered this issue in the OP, in my case it was taking over 20min just to get gradle build going. Getting stuck at the "Resolve dependencies':app_debugCompile'" as well.

I'm still relatively new to Stackoverflow so I can't up-vote yet. But what I can tell you is that if your behind a web proxy like I am and you've just updated to Android 1.3.1 you will probably notice this issue immediately. I already had my companies web proxy in the IDE settngs and yes there is something not ok with the 1.3.1 update. As corochann posted you have to add the proxy info to the gradle.properties of your project. Once I actually did this I noticed the difference immediately. Going forward until its resolved you'll probably have to add this to each project if your behind a web proxy and running 1.3.1. I have another machine at home that isn't behind a proxy and is running Android Studio version before 1.3.0 and had no issues. Hope this helps!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM