我尝试创建自己的 Xamarin Android 库绑定(bind)。
构建过程没问题。
但是当我在库上运行一些方法时,它会抛出异常
Java.Lang.IllegalStateException: 'Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android''
我尝试将 EmbeddedReferenceJar 添加到 kotlinx-coroutines-android 和 kotlinx-coroutines-core 但仍然出现同样的错误。
最佳答案
可能与此有关issue在 Xamarin.Android 中。 已在 v 10.1 中修复,请参阅 release notes .
所以只需尝试更新 Visual Studio(可能是最新的预览版)
关于c# - 缺少带有主调度程序的模块。添加提供主要调度程序的依赖项,例如 'kotlinx-coroutines-android',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58006393/