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:16

I got this problem on Android studio, there in either sync or build square were this link like blue text about this issue, press that button and it download something that fix this problem

查看更多
ら.Afraid
3楼-- · 2019-01-21 04:16

Delete "build" folder from project's root folder. Then do "invalidate cache and restart". This will restart your Android Studio and then build the app again, will solve the issue.

查看更多
孤傲高冷的网名
4楼-- · 2019-01-21 04:18

Solution is

  1. Connect your computer to the internet

  2. Click

Sync project with Gradle files

On toolbar enter image description here

It will automatically sync the gradle.

查看更多
乱世女痞
5楼-- · 2019-01-21 04:18

If no error messages are shown: sometimes the command-line gradle shows them. Just go the the command-line, change to the app directory and type

gradle installDebug

or, if the details are missing

gradle --info installDebug

This can provide additional information how to debug the problem.

查看更多
狗以群分
6楼-- · 2019-01-21 04:18

Resolution is simple. Open the "Android SDK Manager", update all packages and then restart your Android Studio. After that you project should compile without any issues.

查看更多
Lonely孤独者°
7楼-- · 2019-01-21 04:20
  1. Goto File -> Invalidate caches / Restart
  2. Shutdown Android Studio
  3. Rename/remove .gradle folder in the user home directory
  4. Restart Android Studio (It will download gradle metadata and data)
  5. Gradle build succeed
  6. Rebuild project. Done.
查看更多
登录 后发表回答