When I run an app in emulator from android studio, I get an exception. but actually, the class can be found on the jar android.logging.log4j-1.0.3.jar; and I also put the dependency to the build.gradle.
dependencies {
compile 'com.android.support:support-v4:21.1.1'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.code.gson:gson:2.6.2'
compile files('libs/android-viewbadger.jar')
compile files('libs/commons-collections-3.2.1.jar')
compile files('libs/commons-io-2.4.jar')
compile files('libs/commons-lang-2.3.jar')
compile files('libs/aspectjrt-1.7.3.jar')
compile files('libs/isoparser-1.0.2.jar')
compile files('libs/picasso-2.5.2.jar')
compile files('libs/glide-3.7.0.jar')
compile files('libs/android-query-full.0.26.8.jar')
compile 'log4j:log4j:1.2.17'
compile 'de.mindpipe.android:android-logging-log4j:1.0.3'
}
The exception is the following.
Caused by: java.lang.ClassNotFoundException: Didn't find class "de.mindpipe.android.logging.log4j.LogConfigurator" on path: DexPathList[[zip file "/data/app/com.test.app-1/base.apk", zip file "/data/app/com.test.app-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/test.app-1/lib/x86, /system/fake-libs, /data/app/com.test.app-1/base.apk!/lib/x86, /data/app/com.test.app-1/split_lib_slice_0_apk.apk!/lib/x86, /data/app/com.test.app-1/split_lib_slice_1_apk.apk!/lib/x86, /data/app/com.test.app-1/split_lib_slice_2_apk.apk!/lib/x86, /data/app/com.test.app-1/split_lib_slice_3_apk.apk!/lib/x86, /data/app/com.test.app-1/split_lib_slice_4_apk.apk!/lib/x86, /data/app/com.test.app-1/split_lib_slice_5_apk.apk!/lib/x86, /data/app/com.test.app-1/split_lib_slice_6_apk.apk!/lib/x86, /data/app/com.test.app-1/split_lib_slice_7_apk.apk!/lib/x86, /data/app/com.test.app-1/split_lib_slice_8_apk.apk!/lib/x86, /data/app/com.test.app-1/split_lib_slice_9_apk.apk!/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.test.app.MyApp.initLog4j(MyApp.java:268)
BTW, the exception didn't occur before. when I upgraded to 3.3, the issue occur (Maybe, not very sure); now I don't know how to let it work.
I did more search on it. and find all classes for dependencies can't be found. not sure if they were not added into the apk.
I also checked others link, such as, android studio java.lang.NoClassDefFoundError:
none of them works.