1

I am experiencing a problem building my application in Android Studio. I am using Android Studio 2.2 Preview 7. When I start up my Android Studio it gives an error:

The plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to xxxxxxx.

It requests I fix plugin version and sync project. I have made all the required updates but the error remains. I have read similar questions on the issue but they don't seem to apply to my case.

Could you please assist in providing me with a working solution?

Here is my build.gradle file:

apply plugin: 'com.android.application'

android {
  compileSdkVersion 23
  buildToolsVersion "23.0.3"
  defaultConfig {
    applicationId "com.mobileappdev.novarttech.sunshine"
    minSdkVersion 10
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
  })

  compile 'com.android.support:appcompat-v7:23.3.0'
  compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
  compile 'com.android.support:design:23.3.0'
  testCompile 'junit:junit:4.12'
}
ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
Sineke
  • 37
  • 7
  • 3
    I believe this other question may be helpful: http://stackoverflow.com/questions/34572458/android-studio-2-0-plugin-is-too-old-please-update-to-a-more-recent-version. You need to update gradle tools – Claudio Redi Nov 21 '16 at 16:26

2 Answers2

0

As per my observation it seems like you haven't updated Android SDK platform to version 25. First of all download and install android sdk platform and build tools from SDK Manager and use the following lines in your build.gradle(module app)

compileSdkVersion 25
buildToolsVersion "25.0.0"

Also update dependencies according to that. It should work then

Rahul Sharma
  • 2,867
  • 2
  • 27
  • 40
0

As @claudio-redi says, you need to upgrade your build gradle tools.

Use build tools 2.2.2 to your root build.gradle:

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

And change the gradle distribution to 2.14.1 in gradle/wrapper/gradle-wrapper.properties file with:

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

Or if you already have download the gradle distribution and place it in a directory, you can set it in your Android Studio from menu File->Setting->Gradle and set it as the following image:

enter image description here

Please be noted when you want to use API Level 25 you need to make sure that compileSdkVersion, buildToolsVersion, targetSdkVersion, and Support Library using the same API Level 25.

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96