I have Android Studio 2.0 Beta 6
and the Gradle version in build.gradle is classpath 'com.android.tools.build:gradle:2.1.0-beta1'
(I updated it today only, earlier I was at gradle:2.0.0-alpha9).
Now when I try to Run my app I keep getting this Message.
UnsupportedMethodException
Unsupported method: InstantRun.getRestartDexFile().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect.
Alternatively, you can ignore this exception and read other information from the model.
Everything was running fine before the upgrade (including Instant Run).
Please help.
I am posting this as an answer because this solved the problem for me.
I changed the classpath in build.gradle to
classpath 'com.android.tools.build:gradle:2.1.0-alpha3
I did not change anything else/any setting at all, neither did I updated my Android Studio.
Link to the page where I found it.
Had to search a lot. :)
Edit:
Alternatively as pointed out by others,
1. You can either try Upgrading Your Android Studio to 2.1.0 (OR)
2. You can try changing the classpath in build.gradle to
classpath 'com.android.tools.build:gradle:2.1.0
I ran into the same exception
Alternatively, you can ignore this exception and read other information from the model.
It says there is an alternative solution, so what should we do to ignore this exception ?
OK, upgrading the Android Studio will solve the problem.
I get the trouble on Android 2.1 preview 5.I changed the classpath in build.gradle to
classpath 'com.android.tools.build:gradle:2.0.0'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With