简体   繁体   中英

Instant run won't work on Android Studio, says Gradle Version 2.10 is required. I use 2.10

This is the error I get:

Error:Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in /Users/alinrosu/Workspace/passenger-android/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip

I use this inside my buildscript:

dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-alpha5'
}

This is my gradle-wrapper.properties file:

#Tue Jan 05 13:28:23 CET 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

As you can see. I use gradle version 2.10. Do I need to refresh the cache somehow? I Tried clean, rebuild, but nothing works

You need set Use default gradle wrapper in

Settings > Builds,Execution,Deployment > Build Tools > Gradle >Project-level settings

I just changed mine

dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-alpha5'
}

for this

dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0'
}

For me its working

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM