aliyun / alicloud-android-demo

990 stars 550 forks source link

使用热修复Sophix,加载补丁后导致应用崩溃。kotlin,协程出现找不到 #203

Open diswy opened 5 years ago

diswy commented 5 years ago

按文档集成了Sophix,在不使用kotlin协程的情况,加载补丁后都是可以正常运行,实现热修复。 问题在于,使用了kotlin的协程之后,则会出现如下日志:

java.lang.IllegalStateException: Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android' at kotlinx.coroutines.internal.MissingMainCoroutineDispatcher.missing(MainDispatchers.kt:73) at kotlinx.coroutines.internal.MissingMainCoroutineDispatcher.isDispatchNeeded(MainDispatchers.kt:54) at kotlinx.coroutines.DispatchedKt.resumeCancellable(Dispatched.kt:373) at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:25) at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:109) at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:160) at kotlinx.coroutines.channels.ActorKt.actor(Actor.kt:121) at kotlinx.coroutines.channels.ActorKt.actor$default(Actor.kt:112)....

提示Module with the Main dispatcher is missing该错误,问题可以复现,希望工程师可以解决一下该问题。kotlin版本 1.3.20,协程版本1.1.1

SducodeMonkey commented 5 years ago

热修复相关问题,可以添加钉钉群:21710469,有技术支持同学实时响应。