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

安卓端按返回键退出应用,多次操作会导致crash #28

Open
shengbowen opened this issue Oct 9, 2020 · 1 comment
Open

Comments

@shengbowen
Copy link

 java.lang.RuntimeException: Unable to destroy activity {cn.com.gf/com.tarodemo.MainActivity}: java.lang.IllegalArgumentException: Receiver not registered: expo.modules.av.AVManager$1@615cbed
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4605)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4623)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at android.app.ActivityThread.-wrap5(Unknown Source:0)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1757)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:105)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:164)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6944)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: Receiver not registered: expo.modules.av.AVManager$1@615cbed
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:1183)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1456)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:658)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:658)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at expo.modules.av.AVManager.onHostDestroy(AVManager.java:184)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at org.unimodules.adapters.react.services.UIManagerModuleWrapper$3.onHostDestroy(UIManagerModuleWrapper.java:170)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at com.facebook.react.bridge.ReactContext.onHostDestroy(ReactContext.java:237)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager.moveToBeforeCreateLifecycleState(ReactInstanceManager.java:687)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager.onHostDestroy(ReactInstanceManager.java:596)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager.onHostDestroy(ReactInstanceManager.java:610)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at com.facebook.react.ReactActivityDelegate.onDestroy(ReactActivityDelegate.java:117)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at com.facebook.react.ReactActivity.onDestroy(ReactActivity.java:70)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at android.app.Activity.performDestroy(Activity.java:7522)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1255)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4592)
10-09 15:05:33.594 31174 31174 E AndroidRuntime: 	... 9 more
10-09 15:05:33.602  1558  3224 D AppErrorSuggester: Not install apperror suggest center
10-09 15:05:33.602  1558  3224 D AppErrorSuggester: suggest code:0
10-09 15:05:33.602  1558  3224 D Debug   : !@DumpState : SHIP
10-09 15:05:33.602  1558  3224 D Debug   : !@DumpState : debug level:0x4f4c
10-09 15:05:33.603  1558  3224 D Debug   : !@Dumpstate : Finally, system will skip dumpstate
10-09 15:05:33.603  1558  3224 W ActivityManager: crash : cn.com.gf,0

crash 报错信息如上。
搜了下,是expo-av的一个bug。
有修复链接如下 expo/expo#6099

taro-native-shell 应该要升级下包版本吧。

我目前的解决方式是直接修改node_modules中源码,用patch-package 工具打patch解决问题。

@zhiqingchen
Copy link
Member

对应哪个分支?

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

2 participants