I just upgraded to AS 2.0 Preview 8 and I'm trying to build my old project. 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:
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. I was also having the same problem with Java7. What am I missing?
The problem with my project was due to a change in the gradle-experimental
plugin:
+= no longer works for collections. Adding items to the list can be done with the 'add' or 'addAll' method. eg CFlags += "-DCUSTOM_DEFINE" can be replaced with CFlags.add("-DCUSTOM_DEFINE")
Changed those occurrences and the build finished successfully.
Oddly enough, this was fixed by simply doing a Gradle clean
. Hope this helps someone else as this was not intuitive
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.