Skip to content Skip to sidebar Skip to footer

Using .aar Noclassdeffounderror But Class Exists And Is Dexed

I have several projects which I build to create an .aar. I then import this .aar into into Android Studio under /libs. The build.gradle file for this dependency looks as follows: r

Solution 1:

I run into the same issue. The fix is firstly to deploy the AAR file to a local maven (I utilized the plugin at https://github.com/dcendents/android-maven-gradle-plugin). Then I referenced to the local maven as described at https://stackoverflow.com/a/23045791/2563009. And eventually I declared the dependencies with a transitive option, like this:

dependencies {
  compile('com.myapp.awesomelib:awesomelib:0.0.1@aar') {
    transitive = true
  }
}

The error would be gone then.

Solution 2:

Just fyi, you can use a simpler syntax, which is valid too

compile'com.myapp.awesomelib:awesomelib:0.0.1'

Don't forget to omit the @aar thing at the end of the library name

Post a Comment for "Using .aar Noclassdeffounderror But Class Exists And Is Dexed"