I have a .aar file which I added to the libs folder and inside gradle I have
compile(name:'file-name', ext:'aar')
It compiles fine, but when I run it I get:
System.err: java.lang.NoClassDefFoundError: com.app.foo.MUtil$3
Now this MUtil class is used inside the API method of the .aar library I use inside my app. I could see the MUtil class in the exploded-aar folder and I can even go to that class by ctrl+click on its usage. But still NoClassDefFoundError
. Why?
Gradle file
apply plugin: 'com.android.application'
apply plugin: 'maven'
apply plugin: 'com.neenbedankt.android-apt'
repositories {
mavenCentral()
maven { url 'https://clojars.org/repo/' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
flatDir {
dirs 'libs'
}
}
android {
compileSdkVersion 23
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.xxx.xxx"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
productFlavors {
}
lintOptions {
abortOnError false
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:cardview-v7:23.0.+'
compile 'com.android.support:recyclerview-v7:23.0.+'
compile 'com.android.support:appcompat-v7:23.1.1'
compile('xx.xxx.xxxx:xx-xxx:0.1.2@aar') {
transitive = true
}
}
task wrapper(type: org.gradle.api.tasks.wrapper.Wrapper) {
gradleVersion = '2.5'
}