android - 致命异常:java.lang.UnsatisfiedLinkError centrifuge-android
问题描述
我们使用 centrifuge lib 与 Sockets 进行通信。一切正常,但这段代码:
val credentials = Centrifuge.newCredentials(
getCurrentUserId(),
webSocketToken.timestamp,
EMPTY_STRING,
webSocketToken.token
)
抛出这个错误,它只发生在基于 arm 结构的 android 上。这是输出:
Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.namba-_dbpnhlp0R3PyG4erhR_2w==/base.apk"],nativeLibraryDirectories=[/data/app/com.namba-_dbpnhlp0R3PyG4erhR_2w==/lib/arm64, /system/lib64, /vendor/lib64]]] couldn't find "libgojni.so"
at java.lang.Runtime.loadLibrary0 + 1012(Runtime.java:1012)
at java.lang.System.loadLibrary + 1669(System.java:1669)
at go.LoadJNI.<clinit> + 23(LoadJNI.java:23)
at java.lang.Class.classForName(Class.java)
at java.lang.Class.forName + 453(Class.java:453)
at java.lang.Class.forName + 378(Class.java:378)
at go.Seq.<clinit> + 28(Seq.java:28)
at go.Seq.touch()
at centrifuge.Centrifuge.<clinit> + 11(Centrifuge.java:11)
at centrifuge.Centrifuge.newCredentials(Centrifuge.java)
at com.namba.websocket.CentrifugoWebSocketClient.createClient + 214(CentrifugoWebSocketClient.kt:214)
at com.namba.websocket.CentrifugoWebSocketClient$initClient$1.invokeSuspend + 145(CentrifugoWebSocketClient.kt:145)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith + 32(ContinuationImpl.kt:32)
at kotlinx.coroutines.DispatchedTask$DefaultImpls.run + 235(Dispatched.kt:235)
at kotlinx.coroutines.DispatchedContinuation.run + 81(Dispatched.kt:81)
at kotlinx.coroutines.scheduling.Task.run + 94(Tasks.kt:94)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely + 586(CoroutineScheduler.kt:586)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely + 60(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run + 732(CoroutineScheduler.kt:732)
解决方案
推荐阅读
- python - 如何在 PowerShell 中使用 here-string 正确编写 pip.ini 和 .condarc 文件?
- c++ - SQLite如何限制记录数
- arcore - Google ARCore 上的确切 VIO 实现是什么
- alias - 如何使用 KeyStore Explorer 程序查找密钥库条目的别名?
- html - 元素改变位置时的逻辑taborder
- google-chrome - PDF.js:文件来源与查看者的不匹配
- google-apps-script - 当数据自动插入谷歌表格时,应用脚本更新时间戳
- android - 使用 FragmentContainerView 和 NavHostFragment 时出错
- javascript - 粘性菜单,向下滚动时隐藏粘性菜单
- php - preg_match() 期望参数 2 是字符串,给定对象