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

前端 未结 30 2970
南方客
南方客 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 18:50

    it was hard to solve but i did it look go to C:\Users(user name)

    delete .gradle file its you didn't see it it may be in hidden files so if you use windows 7 right click then click on properties and click on hidden to be not checked

    then the file will appear then delete it i hope this works

    0 讨论(0)
  • 2020-11-30 18:51

    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.

    0 讨论(0)
  • 2020-11-30 18:52

    Just ignore the error and try running the project anyway. It will fail, but this time you will get a link in the error description. Clicking the link will trigger the automatic update/download of the outdated/missing component.

    In my scenario, the project failed to launch two times, each time another API/SDK component being the culprit.

    In my case I was just trying to launch a sample project I downloaded, having no clue what API level was being targeted or where to look for this information.

    0 讨论(0)
  • 2020-11-30 18:52

    Go to

    file->settings->build,execution,deployment->gradle.
    

    (and set gradle home path from your directory)

    0 讨论(0)
  • 2020-11-30 18:52

    It is a very common issue and the solution is very easy... Just update the SDK in SDK manager(see full instructions below)

    1. Open Android Studio and go to your SDK Manager(File>Settings>SDK Manager)
    2. Check for (-) icon in front of any package and click on it.
    3. Click OK to start updating the SDK.

    Thanks for asking that question :)

    0 讨论(0)
  • 2020-11-30 18:54

    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.

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