问题描述
我能够正确构建应用程序,但是在运行它时出现此错误:
I am able to build the app properly, but when I run it I get this error:
This version of android studio is incompatible with the gradle version used.Try disabling the instant run
推荐答案
您可以使用常规构建运行,而不是即时运行.
You can use normal build run rather than instant run.
先检查
转到设置/首选项> 构建,执行,部署选项> 即时运行,并取消选中所有三个盒子.
Go to Settings/Preferences > Build, Execution, Deployment option > Instant Run and uncheck all the three boxes.
-
升级Gradle服务URL:
Upgrading Gradle services URL:
项目> Gradle>包装器> gradle-wrapper.properties
Project > Gradle > Wrapper > gradle-wrapper.properties
更改网址自
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
到
distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-all.zip
(在此处查找最新的distributionUrl gradle插件版本: http://services.gradle.org/distributions
(Find latest distributionUrl gradle plugin version Here: http://services.gradle.org/distributions
**请确保使用gradle-x.xx-all.zip)
**Make sure to use gradle-x.xx-all.zip)
-
删除您的构建文件夹
Delete your build folder
运行项目时,将自动创建构建文件夹
When you run project, build folder will be created automatically
转到菜单中的构建"选项>清理项目,构建项目
Go to BUILD option in menu > Clean the project, Build the project
它应该无需立即运行即可工作.
It should work without instant run.
这篇关于此版本的android studio与所使用的gradle版本不兼容.尝试禁用即时运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!