當前版本的android studio 與 gradle不兼容。在log中 提示我升級ide和gradle爲最新版,然而我出問題的就是最新版,於是嘗試 禁用Instant Run,但仍然不能解決問題。
報錯內容:
Error running app: This version of Android Studio is incompatible with the Gradle Plugin used.
Try disabling Instant Run (or updating either the IDE or the Gradle plugin to the latest version)
解決方案:
1、禁用Instant Run,在Settings/Preferneces > Build, Execution, Deployment option > Instant Run 中,取消所有的選中項
2、更新gradle services 的url:在project目錄下的 gradle>wrapper>gradle-wrapper.properties中,保持和本地使用的gradle版本一致。
3、刪除project下的build文件夾 (這步可省,因爲clean+rebuild項目後會自動刪除並重新生成新的build相關文件)
4、Clean項目,然後Rebuild項目,再重新編譯。