今天打開android studio又碰到一個奇怪的問題:This version of android studio is incompatible with the gradle version used.Try disabling the instant run
android studio和gradle版本不匹配,我的android studio剛更新完沒多久,應該就是gradle的問題。
果然在stackoverflow上找到了答案:
You can use normal build run rather than instant run Check first Settings/Preferneces > Build, Execution, Deployment option > Instant Run and uncheck all the three boxes. STEP1 (Upgrading gradle services url): Project > Gradle > Wrapper > gradle-wrapper.properties changed url of distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip to distributionUrl=https://services.gradle.org/distributions/gradle-2.11-all.zip STEP 2 (Delete you build folder in project): When you run project, build folder will be crated automatically STEP 3: Go to BUILD option in menu> Clean the project, Build the project It should work without instant run
在這里面這里:distributionUrl=https://services.gradle.org/distributions/gradle-2.11-all.zip //這是以前的版本,最新的參考這里:http://services.gradle.org/distributions
我設置成gradle-2.11-all還是出錯,設置成最新的就好啦。。。。。