AS版本與 gradle不兼容: This version of Android Studio is incompatible with the Gradle Plugin used.

當前版本的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項目,再重新編譯。

發佈了38 篇原創文章 · 獲贊 26 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章