After upgrading to Android Studio 2.3, gradle build cannot build

Error: Could not open the zip file.

The gradle dependency cache may be corrupted (this sometimes happens after a network connection timeout.)

<a href="syncProject">Re-download dependencies and sync project (requires network)</a> <a href="syncProject">Re-download dependencies and sync project (requires network)</a> 

It happened yesterday. I cannot start any of my old projects, and I cannot download this dependency, although I have a good internet connection.

+5
source share
4 answers

I had a similar problem today after upgrading to Android Studio 2.3.

I had to upgrade my build tools to 25.0.0 , you can do this by changing buildToolsVersion and changing compileSdkVersion to 25 in the build.gradle file in your main module.

 android { compileSdkVersion 25 buildToolsVersion "25.0.0" ... } 
+3
source

I had the same error and solution just by making

Assembly> Cleaning

Assembly> Reconstruction

If this does not work, refer to the link below.

fooobar.com/questions/1265041 / ...

+1
source

Steps to solve this problem:

1) Replace the dependencies in the build.gradle (project) file with this code:

classpath 'com.android.tools.build: gradle: 2.3.0'

2) Replace the Url distribution in Gradle -wrapper.properties with this code:

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

3) Remember to use the default Gradle packaging in your project level settings.

0
source

I also ran into this problem after accepting the update. I'm not sure if this is the right approach, but he solved this problem for me.

In build.gradle (Project), I replaced it with the following:

 classpath 'com.android.tools.build:gradle:1.5.0' 

And in build.gradle (Module: app),

 buildToolsVersion '23.0.1' 

After which I synchronized the project with Gradle files. After that, everything worked well, I hope this helps you.

0
source

Source: https://habr.com/ru/post/1265040/


All Articles