Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoClassDefFoundError occurs on JDK 8 #11

Open
mrjohannchang opened this issue Oct 27, 2014 · 4 comments
Open

NoClassDefFoundError occurs on JDK 8 #11

mrjohannchang opened this issue Oct 27, 2014 · 4 comments

Comments

@mrjohannchang
Copy link

I do not want to leak our app's package name, sorry for not attaching the error messages.

We tried this library and it works like a charm widh JDK 7. But I just found out that NoClassDefFoundError would occur if compiling by JDK 8.

Both Java versions are from Oracle.

@casidiablo
Copy link
Owner

Just run a "find and replace" on your package name and put something else. Then post your logs.

@mrjohannchang
Copy link
Author

I/ActivityManager( 6168): Start proc com.company.android.gallery for activity com.company.android.gallery/com.company.android.gallery8.app.LoginActivity: pid=1610 uid=10171 gids={50171, 3003, 1028, 1015, 1006}
D/ActivityThread( 1610): handleBindApplication:com.company.android.gallery
D/ActivityThread( 1610): setTargetHeapUtilization:0.75
D/ActivityThread( 1610): setTargetHeapMinFree:2097152
W/ActivityThread( 1610): Application com.company.android.gallery can be debugged on port 8100...
I/dalvikvm( 1610): Could not find method com.activeandroid.ActiveAndroid.initialize, referenced from method com.company.android.gallery.app.GalleryAppImpl.initializeDatabasesPath
W/dalvikvm( 1610): VFY: unable to resolve static method 14954: Lcom/activeandroid/ActiveAndroid;.initialize (Landroid/content/Context;)V
D/dalvikvm( 1610): VFY: replacing opcode 0x71 at 0x0075
I/dalvikvm( 1610): Could not find method com.activeandroid.ActiveAndroid.dispose, referenced from method com.company.android.gallery.app.GalleryAppImpl.onTerminate
W/dalvikvm( 1610): VFY: unable to resolve static method 14949: Lcom/activeandroid/ActiveAndroid;.dispose ()V
D/dalvikvm( 1610): VFY: replacing opcode 0x71 at 0x0008
I/dalvikvm( 1610): Could not find method com.activeandroid.Cache.reInitNullDatabase, referenced from method com.company.android.gallery.app.GalleryAppImpl$1.onReceive
W/dalvikvm( 1610): VFY: unable to resolve static method 14960: Lcom/activeandroid/Cache;.reInitNullDatabase ()V
D/dalvikvm( 1610): VFY: replacing opcode 0x71 at 0x000e
I/dalvikvm( 1610): Could not find method com.activeandroid.Cache.reInitDatabase, referenced from method com.company.android.gallery.app.GalleryAppImpl$1.onReceive
W/dalvikvm( 1610): VFY: unable to resolve static method 14959: Lcom/activeandroid/Cache;.reInitDatabase ()V
D/dalvikvm( 1610): VFY: replacing opcode 0x71 at 0x001a
I/MultiDex( 1610): VM with version 1.6.0 does not have multidex support
I/MultiDex( 1610): install
I/MultiDex( 1610): MultiDexExtractor.load(/data/app/com.company.android.gallery-1.apk, false)
I/MultiDex( 1610): loading existing secondary dex files
I/MultiDex( 1610): load found 1 secondary dex files
I/MultiDex( 1610): install done
E/AndroidRuntime( 1610): FATAL EXCEPTION: main
E/AndroidRuntime( 1610): Process: com.company.android.gallery, PID: 1610
E/AndroidRuntime( 1610): java.lang.NoClassDefFoundError: com.activeandroid.ActiveAndroid
E/AndroidRuntime( 1610):        at com.company.android.gallery.app.GalleryAppImpl.initializeDatabasesPath(GalleryAppImpl.java:197)
E/AndroidRuntime( 1610):        at com.company.android.gallery.app.GalleryAppImpl.onCreate(GalleryAppImpl.java:145)
E/AndroidRuntime( 1610):        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
E/AndroidRuntime( 1610):        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4473)
E/AndroidRuntime( 1610):        at android.app.ActivityThread.access$1500(ActivityThread.java:144)
E/AndroidRuntime( 1610):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
E/AndroidRuntime( 1610):        at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 1610):        at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 1610):        at android.app.ActivityThread.main(ActivityThread.java:5146)
E/AndroidRuntime( 1610):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1610):        at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 1610):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
E/AndroidRuntime( 1610):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
E/AndroidRuntime( 1610):        at dalvik.system.NativeStart.main(Native Method)

@casidiablo
Copy link
Owner

Did you add com.activeandroid.ActiveAndroid.class to the --main-dex-list file? It might be that the order in which classes are packed in the different dex files is different depending on the JDK version used. So you should try using --main-dex-list like the README section advises.

@JaceyPenny
Copy link

What was your solution? Having trouble with something similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants