1. 程式人生 > >This version of android studio is incompatible with the Gradle Plugin used

This version of android studio is incompatible with the Gradle Plugin used

日誌資訊(Error running app)

this version of android studio is incompatible with the Gradle Plugin used. Try disabling instant Run (of updating either the IDE or the Gradle plugin to the latest version)

出現這個問題的原因:

因為專案app分包需要,將工程的graddle版本升至了2.2.0 alpha4,而我的android studio 一向升級為最新版,於是就出現了題目中的報錯:

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)

當前版本的android studio 與 gradle不相容。在log中 提示我升級ide和gradle為最新版,然而我出問題的就是最新版,於是嘗試 禁用Instant Run,但仍然不能解決問題。

step1:

禁用Instant Run,在Settings/Preferneces > Build, Execution, Deployment option > Instant Run 中,取消所有的選中項。
這裡寫圖片描述

step2

step3

刪除project下的build資料夾
這裡寫圖片描述

step4:

clean專案,重新編譯跑程式