我是 Realm 和 Android 开发的新手,正在尝试从 Atlas 查询文档。我能够成功地对用户进行身份验证,但是当我尝试执行查询时,我收到以下错误:E/REALM_JAVA: Session Error[wss://realm.mongodb.com/]: WRONG_PROTOCOL_VERSION(realm::sync::ProtocolError:105): sync client must have a sync protocol version of at least 3 to sync on this application, but found version 2. Please update your application to use a newer SDK
我目前正在开发 Android Realm SDK 和 Android SDK Platform 30 的 10.4.0 版本。我已经尝试寻找两者的更新,它说一切都是最新的。这是我的代码:
app.loginAsync(emailPasswordCredentials, it -> {
if (it.isSuccess()) {
Log.v("AUTH", "Successfully authenticated using an email and password.");
User user = app.currentUser();
String partitionValue = "object_id";
SyncConfiguration config = new SyncConfiguration.Builder(
user,
partitionValue)
.allowQueriesOnUiThread(true)
.allowWritesOnUiThread(true)
.build();
uiThreadRealm = Realm.getInstance(config);
//Debugging - testing Realm Sync queries
Products product = uiThreadRealm.where(Products.class).equalTo("_id", 4).findFirst();
if (product != null) {
Log.v("AUTH", product.toString());
}
Log.v("AUTH", config.toString());
//In-App functions
}
有没有人有办法解决这个问题?