简体   繁体   English

Android Studio 2.2.3 Gradle Build运行卡住

[英]Android Studio 2.2.3 Gradle Build Running Stuck

I download android studio 2.2.3 and load my project. 我下载了android studio 2.2.3并加载了我的项目。 But Gradle Build Running Stuck. 但是Gradle Build运行卡住了。 It continuously shows that and i am not able to run my app. 它不断显示,并且我无法运行我的应用程序。 what is the issue can any one help me with that? 有人可以帮助我解决什么问题?

Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]

在此处输入图片说明

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

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

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

Make sure you have a internet connection. 确保您已连接互联网。
If you have it , so maybe android studio couldn't download classes from Jcenter . 如果有的话,也许android studio无法从Jcenter下载类。 So you have to force android studio to download classes from other resource like Maven . 因此,您必须强制android studio从其他资源(如Maven下载类。

To do that open gradle.build file and change the two jcenter() text with mavenCentral() ("C" in maven"C"entral() must be typed in uppercase) and try syncing with gradle again. 为此,请打开gradle.build文件,并使用jcenter()更改两个jcenter()文本mavenCentral() maven中的“ C”必须以大写形式键入“ C” mavenCentral() “ C”),然后尝试再次与gradle同步。

You don't need to do that every time you open your project. 您无需在每次打开项目时都这样做。 Just do this every time you create a new project in Android studio. 每当您在Android Studio中创建一个新项目时,只需执行此操作。

If you are behind a proxy, create a gradle.properties file next to your build.gradle file with this : 如果你使用代理服务器,创建gradle.properties下一个文件到您build.gradle与此文件:

systemProp.http.proxyHost=YOUR_PROXY
systemProp.http.proxyPort=YOUR_PORT
systemProp.http.proxyUser=USERNAME
systemProp.http.proxyPassword=PASSWORD

systemProp.https.proxyHost=YOUR_PROXY
systemProp.https.proxyPort=YOUR_PORT
systemProp.https.proxyUser=USERNAME
systemProp.https.proxyPassword=PASSWORD

systemProp.http[s].proxyUser and systemProp.http[s].proxyPassword are not required if you don't need to login for your proxy. 如果不需要登录代理,则不需要systemProp.http[s].proxyUsersystemProp.http[s].proxyUser systemProp.http[s].proxyPassword In such a case, remove these lines. 在这种情况下,请删除这些行。

Solutions: 1. update your Build tools. 解决方案:1.更新您的构建工具。 2. Reinstall sdk. 2.重新安装SDK。

In my case, all the executable ".exe" files in "sdk\\build-tools\\25.0.3" folder were corrupted by virus. 就我而言,“ sdk \\ build-tools \\ 25.0.3”文件夹中的所有可执行“ .exe”文件都已被病毒破坏。 solution 2 worked for my perfectly. 解决方案2非常适合我。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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