將Android Studio升級到最新版本後,沒有升級build-tools,無法使用instant run功能,導致運行項目時,報這個錯:
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.
解決的方法:
方法1、可以關掉instant run功能
File--Settings--Build, Execution, Deployment--Instant Run
去掉打勾:Enable Instant Run to hot swap code/resource changes on deploy(default enabled)
方法2、可以升級build-tools;
打開SDK Manager進行更新