升級了Android Studio的工程到gradle 2.0后,在編譯工程的時候提示以下錯誤:
UnsupportedMethodException
Unsupported method: AndroidProject.getPluginGeneration().
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 to.
Alternatively, you can ignore this exception and read other information from the model.
出現(xiàn)這個問題的原因是新版本的Android Studio會檢查“ Instant Run” 這個特性,所以解決辦法就是關(guān)掉這個檢查。
Windows & Linux:
File -> Settings -> Build, Execution, Deployment -> Instant Run.
Mac:
Android Studio -> Preferences -> Build, Execution, Deployment -> Instant Run.

如圖所示