Does Xamarin support Kotlin coroutines in a Xamarin Android Binding Library?

廉价感情. 提交于 2019-12-23 04:03:47

问题


I have an Android Binding Library with Kotlin code, and it exits whenever it hits runBlocking{} in the Kotlin code.

E(28583:28691) ERROR [19] - The worker thread caught an exception: Failed resolution of: Lkotlinx/coroutines/BuildersKt; E(28583:28691) Java.Lang.NoClassDefFoundError: Failed resolution of: Lkotlinx/coroutines/BuildersKt; ---> Java.Lang.ClassNotFoundException: Didn't find class "kotlinx.coroutines.BuildersKt" on path: DexPathList[[zip file "/data/app/de.mycompany.app.myproduct-1/base.apk"],nativeLibraryDirectories=[/data/app/de.mycompany.app.myproduct-1/lib/arm, /vendor/lib, /system/lib]]

In my Kotlin AAR module, I have the following dependencies

implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
=> equivalent Xamarin.Kotlin.StdLib
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.1'
=> equivalent Xamarin.????
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.1"
=> equivalent Xamarin.????

I'm guessing that Xamarin.Kotlin.StdLib doesn't include support for the Kotlinx coroutines.
Is there any way to get support for Kotlinx-coroutines in a Xamarin Android Binding library?

来源:https://stackoverflow.com/questions/56924612/does-xamarin-support-kotlin-coroutines-in-a-xamarin-android-binding-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!