I\'ve recently updated the android studio version of my project from 2.3 Canary 2 to 2.3 Canary 3. Since then the gradle build is failing every time with this error:
If you're using the gradle wrapper, make sure that the distributionUrl
in your gradle/wrapper/gradle-wrapper.properties
is correct and up to date. As of this writing, I use this:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
I had the same problem, fixed with checking gradle home path. This cannary build is no more working with gradle-2.14.1
The below link shows, point gradle path to gradle 3.2 directory.
The problem is the last version of tools 2.3.0-alpha3. Try to use the 2.3.0-alpha2 in project build.gradle
classpath 'com.android.tools.build:gradle:2.3.0-alpha2'
You may face this problem with your previous Project, We will notice that when you create a new application the Gradle build will complete successfully. So just copy paste the grade setting from new project to the previous project.
Steps:
1) Replace Dependencies in build.gradle (project) by this code :
classpath 'com.android.tools.build:gradle:2.3.0'
2) Replace distributionUrl in Gradle-wrapper.properties by this code:
distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
3) Don't forget to use Gradle default wrapper in Project level setting.
See this picture for more information
try upgrading the Gradle version to 3.2.1
change
build:gradle:
from
dependencies { classpath 'com.android.tools.build:gradle +'
to
dependencies { classpath 'com.android.tools.build:gradle:2.2.3'