Error running android: Gradle project sync failed. Please fix your project and try again

前端 未结 30 2971
南方客
南方客 2020-11-30 18:32

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 th

相关标签:
30条回答
  • 2020-11-30 19:12

    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.

    0 讨论(0)
  • 2020-11-30 19:13

    If your got timeout, Check Gradle Scripts -> gradle.properties in Android Studio, I found that I do have set a socket proxy in Android Studio settings, but in this gradle.properties file, my proxy became to http, so I just removed this http proxy setting lines, and finally works.

    0 讨论(0)
  • 2020-11-30 19:14

    Apparently, some platforms could be missing. This is how I solved the problem:

    Do you see an error message that is shown at the bottom of your Android Studio window? It could be a smaller window on the bottom right also.., which looks like:

    Now, Click on that blue link, do as the dialog boxes say (if any)...

    That solved the problem. Hope it helps...

    0 讨论(0)
  • 2020-11-30 19:14

    if you have this failure and have other failures too, like "Unsupported Modules Detected: Compilation is not supported for following modules” maybe you need to solve them first and then it will be solved too. that's what happened to me.

    0 讨论(0)
  • 2020-11-30 19:15

    Goto File -> Invalidate caches / Restart Shutdown Android Studio Rename/remove .gradle folder in the user home directory Restart Android Studio (It will download gradle metadata and data) Gradle build succeed Rebuild project. Done

    0 讨论(0)
  • 2020-11-30 19:17

    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.

    0 讨论(0)
提交回复
热议问题