[英]Unable to load class com.android.build.gradle.managed.NdkConfig$Impl
I just upgraded to AS 2.0 Preview 8 and I'm trying to build my old project. 我刚刚升级到AS 2.0 Preview 8,我正在尝试构建我的旧项目。 I updated it to be
我更新了它
classpath 'com.android.tools.build:gradle-experimental:0.6.0-alpha8'
and updated the gradle-wrapper.properties
to use gradle-2.10-all.zip
, but when I try to build my project I get a Java stactrace saying: 并更新了
gradle-wrapper.properties
以使用gradle-2.10-all.zip
,但是当我尝试构建我的项目时,我得到一个Java stactrace说:
Unable to load class com.android.build.gradle.managed.NdkConfig$Impl
I'm using Java 8 to start AS as well as having that set as the JDK for the project. 我正在使用Java 8来启动AS以及将该项设置为项目的JDK。 I was also having the same problem with Java7.
我也遇到了与Java7相同的问题。 What am I missing?
我错过了什么?
The problem with my project was due to a change in the gradle-experimental
plugin: 我的项目的问题是由于
gradle-experimental
插件的变化:
+= no longer works for collections.
+ =不再适用于集合。 Adding items to the list can be done with the 'add' or 'addAll' method.
可以使用'add'或'addAll'方法将项添加到列表中。 eg CFlags += "-DCUSTOM_DEFINE" can be replaced with CFlags.add("-DCUSTOM_DEFINE")
例如,CFlags + =“ - DCUSTOM_DEFINE”可以替换为CFlags.add(“ - DCUSTOM_DEFINE”)
Changed those occurrences and the build finished successfully. 更改了这些事件并成功完成构建。
Oddly enough, this was fixed by simply doing a Gradle clean
. 奇怪的是,这只是通过简单地做Gradle
clean
。 Hope this helps someone else as this was not intuitive 希望这可以帮助别人,因为这不直观
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.