Process: com.shouji.look, PID: 27695
java.lang.IllegalStateException: Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android' and ensure it has the same version as 'kotlinx-coroutines-core'
at kotlinx.coroutines.internal.o.a(Unknown Source:61)
at kotlinx.coroutines.internal.o.a(Unknown Source:5)
at kotlinx.coroutines.ah.a(Unknown Source:21)
at kotlinx.coroutines.a.a.a(Unknown Source:26)
at kotlinx.coroutines.aa.a(Unknown Source:35)
at kotlinx.coroutines.a.a(Unknown Source:16)
at kotlinx.coroutines.d.a(Unknown Source:44)
at kotlinx.coroutines.c.a(Unknown Source:0)
at kotlinx.coroutines.d.a(Unknown Source:14)
at kotlinx.coroutines.c.a(Unknown Source:0)
at com.jarvan.fluwx.handlers.FluwxShareHandler$DefaultImpls.shareWebPage(Unknown Source:54)
at com.jarvan.fluwx.handlers.FluwxShareHandler$DefaultImpls.share(Unknown Source:60)
at com.jarvan.fluwx.handlers.FluwxShareHandlerCompat.share(Unknown Source:10)
at com.jarvan.fluwx.FluwxPlugin.onMethodCall(Unknown Source:176)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(Unknown Source:17)
at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(Unknown Source:59)
at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(Unknown Source:6)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:160)
at android.app.ActivityThread.main(ActivityThread.java:6718)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
如果你是flutter程序,在debug模式下没有问题,release下出现此问题,就直接看混淆就好了 这样加混淆是不行滴
# ServiceLoader support
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
-keepnames class kotlinx.coroutines.android.AndroidExceptionPreHandler {}
-keepnames class kotlinx.coroutines.android.AndroidDispatcherFactory {}
# Most of volatile fields are updated with AFU and should not be mangled
-keepclassmembernames class kotlinx.** {
volatile <fields>;
}
额外还需要把kotlinx整个keep了
-keep class kotlinx.coroutines.** {*;}