You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MongoDB Device Sync匿名登录login()函数无法完成执行

MongoDB Device Sync匿名认证异常排查

问题详情

在MongoDB Device Sync中使用匿名认证时,Logcat未输出任何错误日志。执行以下代码时,第一个日志Logging in正常打印,但login()方法后的Completed日志始终没有输出:

viewModelScope.launch {
     Log.d("HomeViewModel", "Logging in")
     App.create(APP_ID).login(Credentials.anonymous())
     Log.d("HomeViewModel", "Completed")
}

此外,必须在Gradle构建文件中添加以下打包配置,否则会触发编译错误:

packaging {
    resources {
        excludes += "/META-INF/**"
        excludes += "kotlin/annotation/annotation.kotlin_builtins"
        excludes += "kotlin/internal/internal.kotlin_builtins"
        excludes += "kotlin/collections/collections.kotlin_builtins"
        excludes += "kotlin/reflect/reflect.kotlin_builtins"
        excludes += "kotlin/ranges/ranges.kotlin_builtins"
        excludes += "kotlin/kotlin.kotlin_builtins"
        excludes += "kotlin/coroutines/coroutines.kotlin_builtins"
        excludes += "DebugProbesKt.bin"
    }
}

对应的编译错误提示:

2 files found with path 'kotlin/annotation/annotation.kotlin_builtins'.
Adding a packagingOptions block may help, please refer to相关文档获取更多信息

内容的提问来源于stack exchange,提问作者Stefan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.12 00:26:14