Error running android: Gradle project sync failed.

2019-01-21 03:38发布

Android Studio (1.2 RC0) keeps telling me Error running android: Gradle project sync failed. Please fix your project and try again. How can I find out what the problem is? Unfortunately the solutions from this SO thread did not help.

21条回答
在下西门庆
2楼-- · 2019-01-21 04:30

It took me some time to resolve this.

  • Updated SDK Build-Tool [Didn't help]
  • Updated CMake [Didn't help]
  • Updated Android SDK Platform-Tools [Didn't help]
  • Updated Android SDK Tools [Didn't help]
  • Updated NDK [Problem solved]

There was a reason, I didn't want to update NDK. When all else failed, I updated NDK and that did the trick.

查看更多
Fickle 薄情
3楼-- · 2019-01-21 04:34

I had the same issue yesterday. After opening the "Android SDK Manager", updating all packages and restarting Android Studio, the project compiled again.

查看更多
Summer. ? 凉城
4楼-- · 2019-01-21 04:34

Download grade files from this url and extract all in a folder:
 https://gradle.org/releases

Open file -> Setting in windows OS or Preferences in mac OS and in "Build, Execution, Deployment"

Click on "Gradle"

Check “Use local cradle distribution” and give that extracted folder path.

Run gradle.bat for Windows OS and gradle file for mac OS in that folder.

Then check “Offline work”.

"your extracted folder path"/gradle-4.10.2/bin/.gradle (for version 4.1.2 you can set your version)

Press OK and enjoy it.

查看更多
登录 后发表回答