设置别名的时候出现了这个

标签: #<Tag:0x00007f6595484408>

await FlutterJPush.setAlias(Api.pushtoken); 这句代码时候 会出现这个错误 java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: MessageReceive

请提供全量的 log
从初始化开始


SDK 版本多少

1赞

flutter_jpush: ^0.0.4

D/FlutterJPushPlugin(22474): register jpush plugin
I/flutter (22474): 初始化jpush
Syncing files to device MI 9 SE…
I/flutter (22474): version---------___1.0.2
I/flutter (22474): 初始化jpush成功
D/JPushReceiver(22474): JPushReceiver
D/FlutterJPushPlugin(22474): MyJPushMessageReceiver init
E/AndroidRuntime(22474): FATAL EXCEPTION: MessageReceiver
E/AndroidRuntime(22474): Process: com.newsmy.smartbox.merchant, PID: 22474
E/AndroidRuntime(22474): java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: MessageReceiver
E/AndroidRuntime(22474): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:605)
E/AndroidRuntime(22474): at io.flutter.embedding.engine.FlutterJNI.invokePlatformMessageResponseCallback(FlutterJNI.java:556)
E/AndroidRuntime(22474): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:131)
E/AndroidRuntime(22474): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:225)
E/AndroidRuntime(22474): at com.jzoom.flutterjpush.FlutterJPushPlugin$MyJPushMessageReceiver.onAliasOperatorResult(FlutterJPushPlugin.java:766)
E/AndroidRuntime(22474): at cn.jpush.android.a.b.run(Unknown Source:90)
E/AndroidRuntime(22474): at android.os.Handler.handleCallback(Handler.java:873)
E/AndroidRuntime(22474): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(22474): at android.os.Looper.loop(Looper.java:201)
E/AndroidRuntime(22474): at android.os.HandlerThread.run(HandlerThread.java:65)
W/artbox.merchan(22474): Accessing hidden method Landroid/telephony/TelephonyManager;->getSimCount()I (light greylist, reflection)
W/artbox.merchan(22474): Accessing hidden method Landroid/telephony/TelephonyManager;->getSimSerialNumber(I)Ljava/lang/String; (light greylist, reflection)
W/artbox.merchan(22474): Accessing hidden method Landroid/telephony/TelephonyManager;->getSubscriberId(I)Ljava/lang/String; (light greylist, reflection)
W/artbox.merchan(22474): Accessing hidden method Landroid/telephony/SubscriptionManager;->getSubId(I)[I (light greylist, reflection)

你这个都不是 JPush 原生的日志

抓取 Android 原生 log 命令:
adb logcat -v time ->a.log
ctrl+c 结束抓取

另外就是你把插件升级到最新吧

你好,我也要到相同问题,flutter_jpush: ^0.0.4
a.txt (1.7 MB)

运行 JPushResult result = await FlutterJPush.setAlias(“40”); 的时候就报错了

你好,版本 flutter_jpush: ^0.0.4, await FlutterJPush.setAlias(“40”)报错
a.txt (1.7 MB)

请先升级到最新版本的插件再测试