我正在使用Android Studio(Canary)2.1 Preview 4。
当我试图改变
classpath 'com.android.tools.build:gradle:2.1.0-alpha4'
至
classpath 'com.android.tools.build:gradle:2.1.0-alpha3'
我收到对话框消息
"The project is using an incompatible version of the Android Gradle plugin"
Android Studio建议将其更改回
alpha4
更新:
但是我可以设置
com.android.tools.build:gradle:1.5.0
。而且我不能设置
com.android.tools.build:gradle:2.0.0
。看起来AS版本和Gradle版本之间没有任何关系。
如何在AS 2.1中设置
2.0.0
gradle veriosn?
最佳答案
Android Studio 2.0 Beta 7仅与发行版的Android gradle build插件(1.5.0)或2.0.0-beta7一起使用。我假设类似的关系适用于AS 2.1 Preview 4,因此它仅适用于构建插件1.5.0或2.1.0-alpha4。
构建插件2.0和2.1应该与2.1完全相同,但添加了对Android N的支持。AndoridStudio也是如此。
A number of developers have asked what the difference is between 2.0 and 2.1. In short:
- 2.0 is nearly done; release candidate 1 was posted yesterday
- 2.1 is basically just 2.0 plus fixes to support the Android N Preview SDK.
资料来源:http://tools.android.com/recent/androidstudio21preview5available
如果要使用2.0构建插件,请安装AS 2.0。
Android Tools project site
Using multiple Android Studio versions
为什么AS版本X仅与构建插件版本X一起使用?
即时运行。由于它是Beta版,因此Instant Run的API和内部结构在不断变化。这是在gradle build插件中完成的。但是,AS使用了不断变化的API,因此也必须对其进行更新。
关于android - Android Studio版本与Gradle插件版本之间有什么关系?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36257689/