繁体   English   中英

Android中的Cloudant同步

[英]Cloudant sync in android

我正在与cloudant一起在远程数据库中进行同步,我尝试调用DatastoreManager,尽管导入了所有软件包之后,在这里我仍然遇到了一些错误。 我是初来乍到的有人指导我。 我已经在下面提交了我的部分代码

File path = getApplicationContext().getDir("datastores", Context.MODE_PRIVATE);
DatastoreManager manager = new DatastoreManager(path.getAbsolutePath());
URI uri = new URI("https://username:password@username.cloudant.com/my_database"); 
Datastore ds  = manager.openDatastore("my_datastore"); // Create a replicator that replicates changes from the remote // database to the local datastore. 
PullReplication pull = new PullReplication(); 
pull.source = uri; 
pull.target = ds; 
Replicator replicator = ReplicatorFactory.oneway(pull);

以下是我的错误代码

java.lang.NoClassDefFoundError:无法解决以下问题:Lcom / google / common / eventbus / EventBus;

有人引导我朝正确的方向前进。 谢谢

您是否已添加guava.jar文件,此导入import com.google.common.eventbus.Subscribe;需要此文件import com.google.common.eventbus.Subscribe; 您可以从这里下载Guava.jar

祝好运!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM