Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android闪退问题修复 #34

Open
litang0908 opened this issue Nov 2, 2020 · 3 comments
Open

Android闪退问题修复 #34

litang0908 opened this issue Nov 2, 2020 · 3 comments

Comments

@litang0908
Copy link
Contributor

最近升级项目Flutter版本后,突然发现在 Android 调用 flutter_qq 闪退(无论是登录还是取消登录,均会闪退),因此尝试做了修复,并且提交了 Pull Request #33 ,需要等待作者合并。

此项目作者可能比较忙,暂时将解决方案贴在此处。

关联ISSUE

#21
#22
#23
#25
#27
#29
#31
#32

闪退日志

Caused by: java.lang.IllegalStateException: Reply already submitted
at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:139)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:231)
at com.github.marekchen.flutterqq.FlutterQqPlugin$OneListener.onComplete(FlutterQqPlugin.java:203)
at com.tencent.connect.common.UIListenerManager.onActivityResult(ProGuard:212)
at com.tencent.tauth.Tencent.onActivityResultData(ProGuard:403)
at com.github.marekchen.flutterqq.FlutterQqPlugin$OneListener.onActivityResult(FlutterQqPlugin.java:236)
at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEnginePluginRegistry.java:691)
at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onActivityResult(FlutterEnginePluginRegistry.java:378)
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:597)
at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:582)
at android.app.Activity.dispatchActivityResult(Activity.java:7590)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4416)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4465)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

错误原因

FlutterQqPlugin.java 中的 OneListener 实例多次创建,会导致 QQ SDK 处理错误,只需要在 FlutterQqPlugin.java 中设置一个 OneListener 实例即可,具体改动可见 litang0908@339c118

解决方案

  1. git clone 这个 repo https://github.com/litang0908/flutter_qq ,此fork自原项目,且做了修复

  2. 将你自己项目配置的 flutter_qq 依赖,改为步骤1中clone的仓库地址

flutter_qq: ^0.0.5

改为

flutter_qq:
    path: ../codes/github/flutter_qq/
(注:此处路径为步骤1中clone项目相对位置)

重新执行 flutter pub get 后运行项目即可。

@wang-zeqi
Copy link

666666666

@zhangji92
Copy link

是不是需要把这个项目clone自己的项目中

@litang0908
Copy link
Contributor Author

是不是需要把这个项目clone自己的项目中

是的,copy到你的项目下面,路径按照你自己的相对路径配置即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants