有一个DropboxAPI示例:开发人员网站上的注释,可帮助您开始使用DropboxAPI进行开发。我按照所有说明操作,复制了你从在线下载获得的libs文件,并将其作为库添加,甚至将其添加到grade.build文件中进行编译,在线注册应用程序后复制应用密钥和密钥!我根本无法让它工作,我没有任何编译错误!一切似乎都很好,但每次我在手机上运行时它都会“意外停止”。这是日志显示的内容:
02-24 00:02:26.607 4741-4741/com.dropbox.examples.notes W/dalvikvm﹕ VFY: unable to find class referenced in signature (Lcom/dropbox/ledger/android/Ledger;)
02-24 00:02:26.607 4741-4741/com.dropbox.examples.notes W/dalvikvm﹕ VFY: unable to find class referenced in signature (Lcom/dropbox/ledger/android/Ledger;)
02-24 00:02:26.607 4741-4741/com.dropbox.examples.notes I/dalvikvm﹕ Could not find method com.dropbox.ledger.android.Ledger.newBuilder, referenced from method com.dropbox.sync.android.CoreAccountManager.initLedger
02-24 00:02:26.607 4741-4741/com.dropbox.examples.notes W/dalvikvm﹕ VFY: unable to resolve static method 5500: Lcom/dropbox/ledger/android/Ledger;.newBuilder ()Lcom/dropbox/ledger/android/Ledger$Builder;
02-24 00:02:26.607 4741-4741/com.dropbox.examples.notes D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x000e
02-24 00:02:26.607 4741-4741/com.dropbox.examples.notes W/dalvikvm﹕ VFY: unable to find class referenced in signature (Lcom/dropbox/ledger/android/Ledger;)
02-24 00:02:26.607 4741-4741/com.dropbox.examples.notes I/dalvikvm﹕ Failed resolving Lcom/dropbox/sync/android/LedgerUrlCallbackImpl; interface 794 'Lcom/dropbox/ledger/android/LedgerUrlCallback;'
02-24 00:02:26.607 4741-4741/com.dropbox.examples.notes W/dalvikvm﹕ Link of class 'Lcom/dropbox/sync/android/LedgerUrlCallbackImpl;' failed
02-24 00:02:26.607 4741-4741/com.dropbox.examples.notes D/dalvikvm﹕ DexOpt: unable to opt direct call 0x1b40 at 0x90 in Lcom/dropbox/sync/android/CoreAccountManager;.initLedger
02-24 00:02:26.617 4741-4741/com.dropbox.examples.notes I/com.dropbox.sync.android.CoreAccountManager﹕ Prepared cache dir '/data/data/com.dropbox.examples.notes/app_DropboxSyncCache/uq7537992psy7ia'.
02-24 00:02:26.617 4741-4741/com.dropbox.examples.notes W/dalvikvm﹕ No implementation found for native Lcom/dropbox/sync/android/NativeLib;.nativeLibIsLoaded:()Z
02-24 00:02:26.617 4741-4741/com.dropbox.examples.notes W/dalvikvm﹕ Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/dropbox/sync/android/NativeLib;
02-24 00:02:26.617 4741-4741/com.dropbox.examples.notes D/AndroidRuntime﹕ Shutting down VM
02-24 00:02:26.617 4741-4741/com.dropbox.examples.notes W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41627898)
02-24 00:02:26.627 4741-4741/com.dropbox.examples.notes E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError: Couldn't load DropboxSync from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.dropbox.examples.notes-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.dropbox.examples.notes-1, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:355)
at java.lang.System.loadLibrary(System.java:525)
at com.dropbox.sync.android.NativeLib.ensureLoaded(NativeLib.java:70)
at com.dropbox.sync.android.NativeLib.<clinit>(NativeLib.java:32)
at com.dropbox.sync.android.CoreAccountManager.initNativeLib(CoreAccountManager.java:228)
at com.dropbox.sync.android.CoreAccountManager.<init>(CoreAccountManager.java:141)
at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:200)
at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:160)
at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:107)
at com.dropbox.examples.notes.NotesAppConfig.getAccountManager(NotesAppConfig.java:15)
at com.dropbox.examples.notes.NoteListFragment.onAttach(NoteListFragment.java:202)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:894)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1093)
at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1195)
at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:291)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
at android.view.LayoutInflater.inflate(LayoutInflater.java:469)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:267)
at android.app.Activity.setContentView(Activity.java:1895)
at com.dropbox.examples.notes.NoteListActivity.onCreate(NoteListActivity.java:17)
at android.app.Activity.performCreate(Activity.java:5133)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2273)
at android.app.ActivityThread.access$600(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1259)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5145)
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)
02-24 00:02:28.997 4741-4741/com.dropbox.examples.notes I/Process﹕ Sending signal. PID: 4741 SIG: 9
这是网站:https://www.dropbox.com/developers/sync/sdks/android
示例位于sdks文件(6MB)
中