8

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

rosu alin
  • 5,674
  • 11
  • 69
  • 150

2 Answers2

16

You need set Use default gradle wrapper in

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

adrbtk
  • 4,470
  • 1
  • 12
  • 11
  • I get this now, before installing apk: Failed to finalize session : INSTALL_FAILED_INVALID_APK: Split lib_main was defined multiple times – rosu alin Jan 15 '16 at 15:54
  • 1
    same to http://stackoverflow.com/questions/34803518/split-lib-main-was-defined-multiple-times – adrbtk Jan 15 '16 at 15:56
  • Thanks!! I guess instarun is at fault here. Will set this as answered, and disable instarun for now. Thank you – rosu alin Jan 15 '16 at 16:03
  • @adrbtk I use mac and I don't see "Use default gradle wrapper" option (Project-level settings has no options inside it), do you know what should I change? – MorZa Jan 25 '16 at 09:55
  • 1
    @adrbtk Thanks. I found out it's not under Settings like in Windows, but under Peferences, just like in your screen shot. I opened a question and answered it here: http://stackoverflow.com/questions/34990865/android-studio-on-mac-use-default-gradle-wrapper/35012551#35012551 – MorZa Jan 30 '16 at 14:14
0

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