2

so I'm pretty new to programming so this might be a very obvious mistake but I appreciate any input anyone can provide to help me.Whenever I try to create a new project in Android Studio after my update (3.1.3) I get the following error:

Failed to open zip file. Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)

I've tried following:

  • Re-download dependencies and sync project.
  • Searched on stackoverflow and there was a suggestion to delete my gradle files and reopen the app and a newer version of a gradle would download, this did not work.
  • Invalidate the caches in accordance with another stackoverflow suggestion.
  • I believe that my distribution URL is updated.

Something also strange when I try and open old projects that I've made, Android Studio asks if I want to updated Android Gradle Plugin to version 3.1.3 and Gradle to version 4.4. If I click update I get the error message same as before, but if I don't update the projects open fine. Once I have selected update for a certain project there is no way back and it will not open for me.

Thanks for any and all help!

Zach
  • 33
  • 7
  • what is the `distributionUrl` in your gradle-wrapper.properties? – Sagar Jun 20 '18 at 03:54
  • distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip – Zach Jun 21 '18 at 03:09
  • Update: I was able to solve this problem. The issue was that in my app build.gradle file the classpath line need to update to dependencies { classpath 'com.android.tools.build:gradle:3.1.3'} from 3.1.2 (the version I had used when making the project originally. – Zach Jun 21 '18 at 03:27
  • Can anyone tell me why I'm still having this issue when trying to create a new project where the dependencies are already set to 3.1.3. I thought that was the issue but I guess not? – Zach Jun 22 '18 at 02:53
  • Zach, could you tell if you have found the solution? – Alexander May 16 '19 at 18:11

0 Answers0