Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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?

like image 934
FuriousGeorge Avatar asked Feb 03 '16 19:02

FuriousGeorge


2 Answers

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. e.g. CFlags += "-DCUSTOM_DEFINE" can be replaced with CFlags.add("-DCUSTOM_DEFINE")

Changed those occurrences and the build finished successfully.

like image 128
jlhonora Avatar answered Oct 19 '22 12:10

jlhonora


Oddly enough, this was fixed by simply doing a Gradle clean. Hope this helps someone else as this was not intuitive

like image 2
FuriousGeorge Avatar answered Oct 19 '22 13:10

FuriousGeorge