I was syncing fine and then suddenly when I tried to run a test on a device from Android Studio I started getting the error:
Error:(1, 0) Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable ...
I've looked around and I found from the gradle website that the latest version is 2.10, I tried adding that to my dependencies with no luck. I've tried various version numbers with various errors like the following:
Could not find com.android.tools.build:gradle:2.1
Searched in the following locations ...
I understand from all the searching I've done that its clearly a wrong version of gradle - but what IS the current version label I should be using, and how do I know it is installed on my machine ? I've always kept Android Studio updated.
So I currently have in the build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha1'
}
UPDATED (28/03/2017):
2.4.0-alpha3 is the latest release
classpath 'com.android.tools.build:gradle:2.4.0-alpha3'
Check https://bintray.com/android/android-tools/com.android.tools.build.gradle/view for the latest gradle versions.
2.0.0-alpha1 is on the Canary channel and apparently these releases come with an expiry date. 2.0.0-alpha3 is the latest release. Switch to
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
and you should be fine. Keep checking http://tools.android.com/tech-docs/new-build-system to know the latest releases.
You might run into some Dex error. I had to do Build > Clean Project once to get it to work.