I'm getting stuck with android library stuff.
I have
- a project dedicated for the library (let's call it jokerly).
- a project with the application (let's call it testPhilippe)
- a jar generated from the lib (let's call it jokerly.jar)
This jokerly lib is a graphical library using views, xml, pics, and generated files (eg R.java).
I manage to start my app without any problems with the import of the jokerly lib (the project) in properties/android/library. Everything works fine - here is the pic :
!
On the other hand, when I try to import the jokerly.jar (and removing the jokerly lib project from the same place as above) in the java build path, I've got a classNotFound Exception, whatever the state of the checkbox and the position of the jokerly.jar in the properties/javabuildpath/order and export. I also tried to put it in the libs folder manually, but the problem is the same.
java.lang.RuntimeException: Unable to instantiate application com.example.testphilippe.Jokerly: java.lang.ClassNotFoundException: Didn't find class "com.example.testphilippe.Jokerly" on path: DexPathList[[zip file "/data/app/com.example.testphilippe-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.testphilippe-2, /vendor/lib, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:509)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4417)
at android.app.ActivityThread.access$1300(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.testphilippe.Jokerly" on path: DexPathList[[zip file "/data/app/com.example.testphilippe-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.testphilippe-2, /vendor/lib, /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.app.Instrumentation.newApplication(Instrumentation.java:975)
at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
09-11 11:13:37.350: E/AndroidRuntime(22080): ... 11 more
I tried (according to @Vj_Droid advice) some more manips :
I added the jokerly.jar in the java build path (not in the lib folder) from outside the project. I have the same error if the check box is not checked. If I check it, I have the following error. If I add the jokerly.jar manually in the libs folder and then add it into the javabuild paht from the libs folder, I have thee same error (below) even if the box is unchecked.
[2013-09-11 11:59:42 - TestPhilippe] Error generating final archive: Found duplicate file for APK: AndroidManifest.xml
Origin 1: /Users/markelys/Dropbox/Tech/Projets/Android/Workspace/TestPhilippe/bin/resources.ap_
Origin 2: /Users/markelys/Dropbox/Tech/Projets/Android/Workspace/jokerly.jar
Here is what i did for exporting the Jar file :
Feel free to ask more information if you need it !
I've got stuck on it for severals days... Any help will be appreciated !