Android Studio: Re-download dependencies and sync project

天涯浪子 提交于 2019-11-27 09:13:26

While importing a libGDX project I got the same message from Android Studio 2.2.

Went to File->Project Structure then selected Project and set

Gradle version

and

Android Plugin Version

to values identical to another project I had recently created with Android Studio 2.2 and updated SDK. Could then sync gradle. Did Build->Build Clean with no issues. Then did Run->Clean and Rerun and project ran fine.

Hope this helps.

NerdHamel

It basically means that the gradle zip file in the cache folder is corrupted, if you don't want to change the version like the up-voted answer then you must delete the folder for your gradle version you're using for this project from the below path.

Then just retry the sync and android studio will download it again

C:\Users\ [user here]  \.gradle\wrapper\dists

ex: if you're using 3.3 for this project you'd be deleting the folder

C:\Users\[user here]\.gradle\wrapper\dists\gradle-3.3-all

May be incompatible with Gradle and maven version delete project dir/gradle/wrapper put a right version gradle into it run again

I face the same problem and I search for it and found a best solution and i works for me:

  1. Manually download Gradle 3.3 binary (direct link: https://services.gradle.org/distributions/gradle-3.3-bin.zip)

  2. Open your android studio root directory, and extract the zip to the gradle folder (for example: program files/android-studio/gradle/gradle-3.3)

  3. Open Android Studio, go to File->Settings-> (Build, Exectution, Deployment) >Gradle and set "Gradle home" to point your new gradle-3.3 folder.

  4. Apply and sync.

change the gradle-wraper-properties distributionUrl to your local downloaded gradle such as

distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip

I was also facing the same issue. The solution worked for me was go to "gradle\wrapper\dists" and deleted the folder "grade-4.10.1-all" folder and downloaded the same version after that i pasted the extracted folder in same address.After that I again synchronized the android studio. I worked for me.

Clean Project is a way to go. After you clean project, make sure you rebuild it. Usually it solves the gradle issues for me.

In my case I was running IntelliJ IDEA as non root user.

If you want to use the new features, you should not revert it to the old version, just delete the directory ~/.gradle recursively, then restart Android Studio.

Update your gradle version and update with required version of gradle and syn your project.

https://services.gradle.org/

I solved this issue by this following steps

1.C:\Users\System name.gradle\wrapper\

2.Inside wrapper folder u will find grale file with some version, You just have to delete it

3.Come/Go to android studio and Go to File->Sync project with Gradle Files.

4.Android studio automatically download the require gradle file.

5.And now go for coding

The close android studio then goes to the directory and you will find this type of folder. I saw in my pc. after deleted then clean project and sync. its works fine.

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