尝试将ROS v1.8.3与android realm 4.1.0连接,但在连接时出现错误:
Connection[1]: Writing failed: End of input
Connection[1]: Connection closed due to error
Connection[1]: Reconnecting in 472 milliseconds
Connection[1]: Resolving 'ec2....us-west-2.compute.amazonaws.com:9080'
Connection[1]: Connecting to endpoint '34.215.139.88:9080' (1/1)
Connection[1]: Connected to endpoint '34.215.139.88:9080' (from '10.0.2.15:35808')
Connection[1]: WebSocket::initiate_client_handshake()
Connection[1]: HTTP request =
GET /realm-sync/%2F0e38f9551d63d9e08f0d0bf%2Faccount HTTP/1.1
Authorization: Realm-Access-Token version=1 token="ey.......=="
Connection: Upgrade
Host: ec.....us-west-2.compute.amazonaws.com
Sec-WebSocket-Key: azTr3bmRnl1FbSvLCK0pvA==
Sec-WebSocket-Protocol: io.realm.sync.22
Sec-WebSocket-Version: 13
Upgrade: websocket
是版本不兼容问题吗?
以前,它适用于 Realm 3.4.0 构建版本。 我只在迁移过程中所做的更改:
格拉德尔项目:
classpath "io.realm:realm-gradle-plugin:4.1.0"
格拉德尔:
android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.2'
}
代码(<SyncUser>
添加):
SyncUser.loginAsync(syncCred, serverH, new SyncUser.Callback <SyncUser> () {...
在安装新的领域构建之前,应用程序已从手机中删除。
是否需要其他选项?
服务器上的日志:
sync: HTTP Connection[2165]: Connection is closed after HTTP response.
sync: HTTP Connection[2165]: 404 Not Found
sync: HTTP Connection[2165]: HTTP request received, url
sync: HTTP Connection[2165]: Connection initiates HTTP receipt
proxy: attempting to upgrade client ::ffff:93.85.144.134:48862 => headers: {"authorization":"Realm-Access-Token version=1 token="eyJhY...Q=="","connection":"Upgrade","host":"ec....us-west-2.compute.amazonaws.com","sec-websocket-key":"Wtpq5fNSWwwJicg8E8/RTQ==","sec-websocket-protocol":"io.realm.sync.22","sec-websocket-version":"13","upgrade":"websocket"}.}
Realm 4.0.0 已更新为 使用 Realm Sync 2.0.x,这需要 ROS 2.0,而 ROS 2.0 很可能与 ROS 1.x 不兼容。
最后一个使用 Realm Sync 1.x 的版本是 3.7.2
。