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 Only: closing share bottom sheet causes app crash #1291
Comments
|
Interesting...
All reports of crashes should be accompanied by the crash stack trace, can you paste it in here as text? |
|
Hmmm in the metro console I don't get anything... is there a flag I can pass to it to get a higher amount / level of logs? |
|
adb logcat |
|
Ah perfect, thank you! Uh oh, looks like this could be a problem from our side. I will double-check what we were passing as the message, but I thought it was just a plain string... Will update shortly with investigation: 10-14 08:15:27.842 23452 23548 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
10-14 08:15:27.842 23452 23548 E AndroidRuntime: Process: myapp.com, PID: 23452
10-14 08:15:27.842 23452 23548 E AndroidRuntime: com.facebook.react.bridge.UnexpectedNativeTypeException: Value for message cannot be cast from ReadableNativeMap to String
10-14 08:15:27.842 23452 23548 E AndroidRuntime: at com.facebook.react.bridge.ReadableNativeMap.checkInstance(ReadableNativeMap.java:140)
10-14 08:15:27.842 23452 23548 E AndroidRuntime: at com.facebook.react.bridge.ReadableNativeMap.getNullableValue(ReadableNativeMap.java:128)
10-14 08:15:27.842 23452 23548 E AndroidRuntime: at com.facebook.react.bridge.ReadableNativeMap.getString(ReadableNativeMap.java:162)
10-14 08:15:27.842 23452 23548 E AndroidRuntime: at com.facebook.react.modules.dialog.DialogModule.showAlert(DialogModule.java:195)
10-14 08:15:27.842 23452 23548 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-14 08:15:27.842 23452 23548 E AndroidRuntime: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
10-14 08:15:27.842 23452 23548 E AndroidRuntime: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
10-14 08:15:27.842 23452 23548 E AndroidRuntime: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
10-14 08:15:27.842 23452 23548 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:751)
10-14 08:15:27.842 23452 23548 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
10-14 08:15:27.842 23452 23548 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
10-14 08:15:27.842 23452 23548 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
10-14 08:15:27.842 23452 23548 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
10-14 08:15:27.842 23452 23548 E AndroidRuntime: at java.lang.Thread.run(Thread.java:761)
10-14 08:15:27.844 1718 2664 W ActivityManager: Force finishing activity myapp.com/.MainActivityUPDATE: the variable we are using as and I console log out UPDATE: unfortunately this same exception occurs even when I pass an empty options object, i.e.: await Share.open({}) |
As the title states, this small doc change would have saved me from the issue I raised in react-native-share#1291 Totally flexible about the wording or arrangement, I think it's just important to mention somewhere in the docs that closing the sheet throws an error.
|
Finally found the true cause here: I switched our code around the In summary, I believe the docs could be updated to mention this thrown error and show: since some people may assume that closing the sheet just affects what is inside |
…d (#1292) As the title states, this small doc change would have saved me from the issue I raised in react-native-share/react-native-share#1291 Totally flexible about the wording or arrangement, I think it's just important to mention somewhere in the docs that closing the sheet throws an error.
Steps to reproduce
Share.open()call on an Android device.Expected behaviour
The app should not crash.
Actual behaviour
The app crashes.
Environment
react-native-share
Version: npm version or "master" npm 8.19.2
Link to repo (highly encouraged)
I could put this together but I would need time. Good evidence that this is still a bug is shown in #1024 but was marked eventually as stale
Wish I could provide more info, but I don't get any logs from react native, just the immediate crash. Also as mentioned we have tested this on numerous iOS and Android devices and it seems to effect only Android (both emulator and physical devices)
The text was updated successfully, but these errors were encountered: