请这不是DUPLICATE问题
不知道,但我已经将.jar放在libs文件夹中,并完成了以下过程
还
我已查看此I'm getting a java.lang.classnotfoundexception: com.mysql.jdbc.Driver
我已经完成了几个项目,但是第一次使用这个Dropbox示例Project
Lotcat是
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)
即使在Refrenced Libraries中有一个类
请尝试使用此
https://www.dropbox.com/developers/downloads/sdks/datastore/android/dropbox-android-sync-sdk-3.1.1.zip SDK如果您也遇到此类错误 ?
答案 0 :(得分:2)
我遇到了同样的问题。 dropbox-sync-sdk-android.jar存在于类路径中,但在构建过程中未将类包含在生成的apk中。 后来我注意到Android构建控制台中出现了多个错误:
[dx] bad class file magic (cafebabe) or version (0033.0000)
看起来Dropbox API是针对JDK 1.7编译的,当您尝试使用JDK 1.6使用此jar构建APK时会遇到麻烦
我通过更新编译器合规性级别修复了此问题:
Project->Properties->Java Compiler->Compiler compliance level->1.7
还要确保您的Android SDK Build-tools是v19或更高版本:
Android SDK Manager->Android SDK Build-tools->check v21.0.2->uncheck v17(my case)