java.lang.NoClassDefFoundError: com.dropbox.sync.android.DbxAccountManager

◇◆丶佛笑我妖孽 提交于 2019-12-02 03:25:52

问题


Please this will be not DUPLICATE question

Don't know but I have already put .jar in libs folder and also done following process

And also

I have checked this I'm getting a java.lang.classnotfoundexception: com.mysql.jdbc.Driver

I have done several projects but in first time I am getting with this dropbox sample Project

Lotcat is

10-14 13:01:00.580: W/dalvikvm(2902): threadid=1: thread exiting with uncaught exception (group=0x430d5140)
10-14 13:01:00.580: E/AndroidRuntime(2902): FATAL EXCEPTION: main
10-14 13:01:00.580: E/AndroidRuntime(2902): Process: com.dropbox.sample.hellodropbox, PID: 2902
10-14 13:01:00.580: E/AndroidRuntime(2902): java.lang.NoClassDefFoundError: com.dropbox.sync.android.DbxAccountManager
10-14 13:01:00.580: E/AndroidRuntime(2902):     at com.dropbox.sample.hellodropbox.HelloDropboxActivity.onCreate(HelloDropboxActivity.java:44)
10-14 13:01:00.580: E/AndroidRuntime(2902):     at android.app.Activity.performCreate(Activity.java:5403)
10-14 13:01:00.580: E/AndroidRuntime(2902):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
10-14 13:01:00.580: E/AndroidRuntime(2902):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270)
10-14 13:01:00.580: E/AndroidRuntime(2902):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2396)
10-14 13:01:00.580: E/AndroidRuntime(2902):     at android.app.ActivityThread.access$800(ActivityThread.java:139)
10-14 13:01:00.580: E/AndroidRuntime(2902):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293)
10-14 13:01:00.580: E/AndroidRuntime(2902):     at android.os.Handler.dispatchMessage(Handler.java:102)
10-14 13:01:00.580: E/AndroidRuntime(2902):     at android.os.Looper.loop(Looper.java:149)
10-14 13:01:00.580: E/AndroidRuntime(2902):     at android.app.ActivityThread.main(ActivityThread.java:5257)
10-14 13:01:00.580: E/AndroidRuntime(2902):     at java.lang.reflect.Method.invokeNative(Native Method)
10-14 13:01:00.580: E/AndroidRuntime(2902):     at java.lang.reflect.Method.invoke(Method.java:515)
10-14 13:01:00.580: E/AndroidRuntime(2902):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817)
10-14 13:01:00.580: E/AndroidRuntime(2902):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:633)
10-14 13:01:00.580: E/AndroidRuntime(2902):     at dalvik.system.NativeStart.main(Native Method)

Even there is a class in Refrenced Libraries

Please just try with this

https://www.dropbox.com/developers/downloads/sdks/datastore/android/dropbox-android-sync-sdk-3.1.1.zip SDK if you are also getting this kind of error or not ?


回答1:


I had the same problem. The dropbox-sync-sdk-android.jar was existed on the class-path, but the classes were not included to resulting apk during build process. Later I noticed multiple errors in Android build console:

 [dx] bad class file magic (cafebabe) or version (0033.0000)

Looks like Dropbox API is compiled against JDK 1.7 and you will have troubles when trying to build APK with this jar using JDK 1.6

I fixed this issue by updating Compiler compliance level:

Project->Properties->Java Compiler->Compiler compliance level->1.7

Also make sure that your Android SDK Build-tools are v19 or later:

Android SDK Manager->Android SDK Build-tools->check v21.0.2->uncheck v17(my case)


来源:https://stackoverflow.com/questions/26355284/java-lang-noclassdeffounderror-com-dropbox-sync-android-dbxaccountmanager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!