NoClassDefFoundError:无法解决以下问题:Lkotlinx /协程/调度程序

问题描述 投票:0回答:1

[我有一个使用Kotlin Coroutines并将CoroutineScope用作]的库>

private val coroutineScope by lazy(mode = LazyThreadSafetyMode.NONE) {
        CoroutineScope(Dispatchers.Main)
    }

[当我在其他项目中使用库时,出现错误:

com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "kotlinx.coroutines.Dispatchers" on path: DexPathList[[zip file "/data/app/com.ssss.ssss-X44QPiLhKdl-D6eyVAYkOA==/base.apk"],nativeLibraryDirectories=[/data/app/com.ssss.testauthenticater-X44QPiLhKdl-D6eyVAYkOA==/lib/x86, /system/lib, /system/product/lib]]

我也在我的消费者专业保护文件中添加了-keepnames class kotlinx.** { *; }

有人有类似的问题吗?我在Android中使用协程1.3.3。

<<

您能否使用此版本,然后重试:

android kotlin android-library kotlin-coroutines
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.