Android Studio 2.2.3 Gradle Build Running Stuck

风格不统一 提交于 2019-11-28 14:19:44

If you are behind a proxy, create a gradle.properties file next to your build.gradle file with this :

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. In such a case, remove these lines.

AmirHosein

Make sure you have a internet connection.
If you have it , so maybe android studio couldn't download classes from Jcenter. So you have to force android studio to download classes from other resource like 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.

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.

Solutions: 1. update your Build tools. 2. Reinstall sdk.

In my case, all the executable ".exe" files in "sdk\build-tools\25.0.3" folder were corrupted by virus. solution 2 worked for my perfectly. :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!