3

I have a android library project from which i created AAR file. I have added that AAR file into my application project, while running i get the following exception:

Caused by: java.lang.ClassNotFoundException: Didn't find class
"com.creatrixone.customcomponents.LoadMoreListView" on path:
DexPathList[[zip file "/data/app/com.creatrixcampus-1.apk"],
nativeLibraryDirectories=[/data/app-lib/com.creatrixcampus-1, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
    at android.view.LayoutInflater.createView(LayoutInflater.java:559)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 

I updated both Library and Application project gradle file after visiting below link,

Android Library AAR depending on another library

but no use, this is my updated library build.gradle file:

buildscript {
    repositories {
        mavenCentral()
    }

dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
    }
}

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

version '1.1.1'

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.koushikdutta.ion:ion:2.1.7'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.android.support:recyclerview-v7:23.3.0'
    compile 'com.android.support:design:23.3.0'
    compile 'com.android.support:appcompat-v7:23.3.0'

    //session handelling using JWT
    compile 'io.jsonwebtoken:jjwt:0.6.0'

    compile 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
    compile 'com.nhaarman.listviewanimations:lib-manipulation:3.1.0@aar'
    compile 'com.nhaarman.listviewanimations:lib-core-slh:3.1.0@aar'
}


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    useLibrary 'org.apache.http.legacy'

defaultConfig {
    //applicationId "com.creatrixone"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.1.1"
    multiDexEnabled true
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}

packagingOptions {
    exclude 'META-INF/LICENSE.txt'
}

productFlavors {
}

dexOptions {
    incremental true
}
}

this is my updated project build.gradle file:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
    }
}

apply plugin: 'com.android.application'

repositories {
    mavenCentral()
    maven { url "${System.env.HOME}/.m2/repository" }
    flatDir {
        dirs 'libs'
    }
}

android {

compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'

defaultConfig {
    applicationId 'com.creatrixcampus'
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 20160504
    versionName "1.5.0"
    multiDexEnabled true
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),       'proguard-rules.pro'
    }
}

productFlavors {
}

dexOptions {
    javaMaxHeapSize "4g"
    preDexLibraries = false
}

lintOptions {
        checkReleaseBuilds false
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:multidex:1.0.1'
    compile project(':photoViewerLibrary')
    compile project(':multipleImagePick')
    compile 'com.android.support:cardview-v7:23.3.0'
    compile 'com.android.support:recyclerview-v7:23.3.0'
    compile 'com.android.support:design:23.3.0'
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile ':creatrixone1_1@aar'
    compile 'com.google.code.gson:gson:2.4'
    compile 'com.github.alamkanak:android-week-view:1.2.1'
    compile 'com.google.zxing.client.android:barcode_1.0:1.1.0@aar'
    compile 'com.google.zxing:android-integration:3.2.0'
    compile 'com.google.android.gms:play-services-analytics:8.4.0'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
    compile 'xyz.danoz:recyclerviewfastscroller:0.1.3'
    //session handelling using JWT
    compile 'io.jsonwebtoken:jjwt:0.6.0'
    compile 'com.koushikdutta.ion:ion:2.1.7'
}
Community
  • 1
  • 1
Anbarasu Chinna
  • 975
  • 9
  • 28

0 Answers0