一个Android studio 编译的问题

来源:互联网 发布:车机软件 编辑:程序博客网 时间:2024/04/30 22:26

导入了一个工程,编译的时候报了这个错:


Error:(1, 1) A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
   > Minimum supported Gradle version is 2.14.1. Current version is 2.10. If using the gradle wrapper, try editing the distributionUrl in D:\AndroidStudioProjects\Master4\gradle\wrapper\gradle-wrapper.properties to gradle-2.14.1-all.zip


根据提示,需要最小的版本是2.14.1,所以把gradle的版本改成2.14.1


这样编译是没有问题了,但是在手机上运行的时候报这样的错:


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)


按照提示“Try disabling Instant Run (or updating either the IDE or the Gradle plugin to the latest version)”,升级有点耗时,还是disabling Instant Run吧

但是这样还是报错:

还是不行。

网上也有其他解决方法,类似于这位博主的 http://blog.csdn.net/qq_32365567/article/details/52671275


我就看其他工程的配置,配置的gradle的版本也是2.10,可以跑通的。

我就在找根本原因,最终发现是这个地方的问题


这个地方的版本和我AS的版本不一样,所以修改成我自己的版本2.1.2,编译运行,顺利通过。这就是导入别人工程时遇到的问题。


0 0