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'
}
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
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:
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.
Related
i was working on a project, everything was fine but when i tried to run the app, i couldn't,i guess because i'm using a bundled version of google play services. so i i made sure that i update android studio and install the lastest google repository.
but it still wouldn't work. And when i click on install Repostiroy and sync project, still nothing happens.
please help me : this is my gradle ;
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.nefissa.pfe2"
minSdkVersion 16
targetSdkVersion 25
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:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.google.android.gms:play-services:25.1.0'
testCompile 'junit:junit:4.12'
}
please where did i go wrong?
a screenshot;please what can i do? the click on install wouldn't work
replace it with compile 'com.google.android.gms:play-services:10.2.0'
and add apply plugin: 'com.google.gms.google-services' on the bottom of your gradle,
and make sure you added classpath 'com.google.gms:google-services:3.0.0'
in the Top-level build.gradle file
There might one of these problems can cause this issue, try any one of them.
Solution 1:
Try to updated the gradle plugin.
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
Then just Build->Clean project and everything works again.
Solution 2:
Go to the main module in your project, it's usually have the name app.
Then go to > Open Module Settings > in Properties change the Build Tools Version to 25.0.1
Then to make sure open the build.gradle file, and change compileSDKVersion & buildToolsVersion to 25 and 25.0.1 respectively.
If the above solution doesnt work.
Solution 3:
From this answer
"build cache" is enabled by default in build Android Plugin since 2.3.0. It creates files in build cache outside of project folder (e.g. in \Users\%username%.android\build-cache). Theese files are intended to be common between your projects.
And then Android Studio is unable to navigate in theese files.
You can disable Build Cache in gradle.properties file. just add android.enableBuildCache=false
In my Android studio I am only able to see the support libraries for the version 25.0.0 but my compile SDK version is 23 when I try to add com.android.support:recyclerview-v7:23.0.4 I get an error message that
Error:(27, 13) Failed to resolve: com.android.support:recyclerview-v7:23.0.4
but as per the SDK manager it shows that I have installed all the support libraries.
On top of that I am unable to locate the v7:23.0.4 libraries in the menu
File => Project Structure => Dependencies
Here are the screenshots
My Questions
Why am I unable to see the support libraries for the version v7:23.0.4 ?
If the support library is not installed how come it does not show in my SDK Manager ?
EDIT 1
Build.gradle(Module.app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "appnotic.quicknotes"
minSdkVersion 18
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(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.0.2'
}
EDIT 2
1) it is not available from the repository, why? I don't know, but it is not the latest one for version 23, try com.android.support:recyclerview-v7:23.2.1 instead
2) you don't install the libraries with the SDK manager, that only install the source where gradle get the library from, the library itself gets downloaded when you build
I tried with 23.0.4 and could not get it, with 23.2.1 yes. If you can get version 25.0.0 it means that the repository is installed, maybe the gradle project is messed up somehow. Try to delete the project iml file and .idea folder and recreate it.
I have setup android studio 2.2 and my sdk contains api 23 as well as api 24.
My build.gradle file is as below :
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.example.sanjay.myapplication"
minSdkVersion 15
targetSdkVersion 24
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'])
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha1'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support:support-annotations:24.2.1'
}
I have getting below error :
Error:(1, 0) Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to "9d813ee66dd60f65615706c5deaa14afed669ca5"
Fix plugin version and sync project</a><br>Open File
Please let me know, Whats going wrong here, Thank you.
When such error is shown (Plugin is too old, please update to a more recent version, Fix plugin version, and sync project), click on the Fix plugin version and sync project which appeared in the log cat. the Gradle will sync and you are good to go.
Update your Project level Build.gradle to
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
}
Download the latest gradle from https://gradle.org/gradle-download/ and
Goto: Build, Execution, Deployment ->> Build Tools ->> Gradle (Or just type in the searchbar Gradle)
Select: (X) Use local gradle distribution and set Gradle home to your extracted Gradle directory. Click on apply.
Update your Project Build.gradle to
dependencies
{
classpath 'com.android.tools.build:gradle: "latest version here" '
}
see Grade Version Compatibility for Android Studio
I am building a golf score card app with android studio and last night before I shut down my laptop it was building fine, however, this morning when I run Android studio I got the error "Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to "aed79d567e57792ed352e708d2b7ca891ff897c6"" and my app structure has also altered and there is no longer a manifest folder.....image of app structure``
Below is my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.biko.golfstroke"
minSdkVersion 8
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
}
Please help if you can this is so frustrating!
PLZ update your gradle plugin version in the rooter gradle file as following:
classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
check the newest version of android gradle plugin in here
I think the android studio should fix this version problem by himself, it`s a bad experience for changing it manually.
I changed my class path to: classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
and then followed this post:change distribution url
and it was solved....
Thanks for all the help!
I am trying to do an application but there seems to be some error with the gradle files now. It was working fine until I upgraded the support libraries.
I was working with api 21 which worked fine, but then i upgraded to api22 and changed the gradle files accordingly.. Now this error shows up.
Error:Failed to find: com.android.support:support-v4:22.2.0
This is my current gradle file :
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.sampleapp"
minSdkVersion 12
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.jakewharton:butterknife:6.1.0'
}
Any help would be appreciated.
If this might help someone, after MANY trials and errors, I found that I was targeting the wrong SDK version (an older one) in the build.gradle file corresponding to "library". To change this you can do it by hand or go to the Module Settings Menu (right click on your project folder -> Open Module Settings. Then in "library" - Properties you can change the Compile Sdk and the Build Tools Versions
Using Android SDK Manager. Go to Extras and then Android Support Repository and update it to the latest version.
(This is essentially the comment #natario made, but it should be an answer.)