我正在尝试使用dropbox-core-sdk-2.0-beta-4,使用下面的代码从Java桌面应用程序在Dropbox帐户中创建共享文件夹,但我得到以下例外:
java.lang.NoSuchMethodError: com.dropbox.core.json.JsonWriter.writeFields(Ljava/lang/Object;Lcom/fasterxml/jack son/core/JsonGenerator;)V
at com.dropbox.core.v2.DbxFiles$CreateFolderArg$1.write(DbxFiles.java:5337)
at com.dropbox.core.v2.DbxFiles$CreateFolderArg$1.write(DbxFiles.java:5332)
at com.dropbox.core.json.JsonWriter.writeToStream(JsonWriter.java:23)
at com.dropbox.core.json.JsonWriter.writeToStream(JsonWriter.java:33)
at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:82)
at com.dropbox.core.v2.DbxFiles.createFolder(DbxFiles.java:8459)
at com.dropbox.core.v2.DbxFiles.createFolder(DbxFiles.java:8479)
我的代码如下:
DbxRequestConfig dbxRequestConfig = new DbxRequestConfig("test/1.0", Locale.getDefault().toString());
DbxClientV2 dbxClient = new DbxClientV2(dbxRequestConfig, my_access_token);
FolderMetadata md = dbxClient.files.createFolder("/test");
ArrayList<AddMember> list = new ArrayList();
DbxSharing.AddMember a1 = new DbxSharing.AddMember(DbxSharing.MemberSelector.email("xxxxxx@gmail.com"),
DbxSharing.AccessLevel.editor);
list.add(a1);
dbxClient.sharing.addFolderMember(md.parentSharedFolderId, list);
我的代码正在加热:
FolderMetadata md = dbxClient.files.createFolder("/test");
我已经搜索了创建共享文件夹并向其添加成员的任何解决方案,但我找不到对我的案例有用的任何内容。
有谁能告诉我我做错了什么?