2

While building a default project (black template) on Android Studio 3.0 Canary 1, I got the below error.

The android gradle plugin version 3.0.0-alpha1 is too old, please update to the latest version. To override this check from the command line please set the 
ANDROID_DAILY_OVERRIDE environment variable to "d27b293f4c7c48dfe922ba160164f3fa511cb3b9" 
Upgrade plugin to version 3.0.0-alpha1 and sync project Open File

What's wrong with the default setting?

Elye
  • 53,639
  • 54
  • 212
  • 474

5 Answers5

7

Your code may be containing an outdated gradle plugin version (may be alpha1, or something like that) in your project build.gradle file. Update it to the latest alpha4 plugin like below:

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0-alpha4'
}
Midhu
  • 1,647
  • 2
  • 18
  • 29
2

Apparently, the alpha1 is obsolete, even though it is not mentioned anywhere in document I could find.

In the project build.gradle, just change from

classpath 'com.android.tools.build:gradle:3.0.0-alpha1'

to

classpath 'com.android.tools.build:gradle:3.0.0-alpha4' 
Elye
  • 53,639
  • 54
  • 212
  • 474
  • 1
    Yes . I hope you maintain this https://stackoverflow.com/questions/44645099/could-not-find-gradle-3-0-0-alpha4/44645129#44645129 – IntelliJ Amiya Jun 27 '17 at 07:04
  • @IntelliJAmiya - I am getting problem in my project... it isnt compiling with apha4 .. showing problems in manifest... it worked fine before this – Udit Kapahi Jun 27 '17 at 09:22
  • @Udit Kapahi, Try alpha5 – Elye Jul 06 '17 at 04:47
  • @Elye I got it working by adding android.enableAapt2=false to the gradle.properties file. – Udit Kapahi Jul 06 '17 at 09:20
  • Using `android.enableAppt2=false` is not ideal, it is basically turning off the latest feature. It shouldn't be a long term solution. – Elye Jul 07 '17 at 00:05
1

Follow the steps :

  • Go to your Project structure
  • Click on project on left side panel
  • Update the Gradle version to 3.3
  • Click on Ok Button

let it sync and you will be done

MRX
  • 1,400
  • 3
  • 12
  • 32
  • I would like to work on the latest Gradle version 4.0. – Elye Jun 27 '17 at 07:03
  • https://developer.android.com/studio/releases/gradle-plugin.html I guess 3.3 is the latest supported version check out this link – MRX Jun 27 '17 at 07:05
  • @MRX Gradle 4.0 available. Refer https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html gradle:3.0.0-alpha1 was supported till date. Maybe alpha4 will do the trick. – Midhu Jun 27 '17 at 11:16
  • Cool I was not aware about it ... Thanks I will go through it – MRX Jun 27 '17 at 11:18
1

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

its not recommended to use +

Sanchit Panchwatikar
  • 1,329
  • 2
  • 9
  • 5
0

After trying this solutions, I came with this:

buildscript {
  repositories {
    jcenter()
    maven { url 'https://maven.google.com' }
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0-alpha4'
  }
}

add

maven { url 'https://maven.google.com' }

to buldscript repositories.