0

我正在尝试使用 Sync API 将文件上传到 Dropbox,但在上传时出现错误

 W/libDropboxSync.so(status): REQUEST: api_core.cpp:264: HTTP request error 400: v1_retired [dc166c5befd76df2]
W/com.dropbox.sync.android.DbxAccount: Failed to update account info.
com.dropbox.sync.android.DbxException$Request: _jobject* dropboxsync::Java_com_dropbox_sync_android_NativeApp_nativeGetAccountInfo(JNIEnv*, jobject, jlong, jobject) - Invalid server request: HTTP request error 400: v1_retired [dc166c5befd76df2]
at com.dropbox.sync.android.DbxError.exceptionFrom(DbxError.java:296)
 at com.dropbox.sync.android.NativeLib.exceptionFrom(NativeLib.java:254)
        at com.dropbox.sync.android.NativeLib.throwFrom(NativeLib.java:242)
        at com.dropbox.sync.android.NativeApp.nativeGetAccountInfo(Native Method)
        at com.dropbox.sync.android.NativeApp.getAccountInfo(NativeApp.java:175)
        at com.dropbox.sync.android.DbxAccount.fetchAccountInfo(DbxAccount.java:559)
        at com.dropbox.sync.android.DbxAccount.backgroundUpdateAccountInfo(DbxAccount.java:540)
        at com.dropbox.sync.android.CoreBackgroundProcessor$RunAccountInfoUpdate.attemptRun(CoreBackgroundProcessor.java:209)
        at com.dropbox.sync.android.CoreBackgroundProcessor$BackgroundRunner.run(CoreBackgroundProcessor.java:239)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:272)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)

在代码下方,我用于文件上传。从 2 天开始就卡在这个状态。

DbxFileSystem dbxFs = DbxFileSystem.forAccount(HomeActivity.mDbxAcctMgr.getLinkedAccount());
DbxPath path = new DbxPath(recordingData.filePath);
DbxFile mFile;
try {
    mFile = dbxFs.open(path);
} catch (DbxException.NotFound e) {
    mFile = dbxFs.create(path);
}
mFile.addListener(mChangeListener);
4

1 回答 1

1

您尝试使用的 SDK 构建在已停用的 Dropbox API v1 之上:https ://blogs.dropbox.com/developers/2016/06/api-v1-deprecated/

您应该改用 API v2:https ://www.dropbox.com/developers

要使用 Java/Android 的 API v2,我们建议使用官方的 Dropbox API v2 Java SDK:https ://github.com/dropbox/dropbox-sdk-java

于 2019-03-11T20:16:01.740 回答