react-native-image-picker
react-native-image-picker copied to clipboard
[🐛] Illegal callback invocation from native module. This callback type only permits a single invocation from native code.
Description
Application Crash while picking Image.
Caused by java.lang.RuntimeException: Illegal callback invocation from native module. This callback type only permits a single invocation from native code. at com.facebook.react.bridge.CallbackImpl.invoke(CallbackImpl.java:26) at com.imagepicker.ImagePickerModule.onActivityResult(ImagePickerModule.java:184) at com.facebook.react.bridge.ReactContext.onActivityResult(ReactContext.java:305) at com.facebook.react.ReactInstanceManager.onActivityResult(ReactInstanceManager.java:762) at com.facebook.react.ReactDelegate.onActivityResult(ReactDelegate.java:90) at com.facebook.react.ReactActivityDelegate.onActivityResult(ReactActivityDelegate.java:112) at com.facebook.react.ReactActivity.onActivityResult(ReactActivity.java:68) at money.jupiter.MainActivity.onActivityResult(MainActivity.kt:47) at android.app.Activity.dispatchActivityResult(Activity.java:8113) at android.app.ActivityThread.deliverResults(ActivityThread.java:5037) at android.app.ActivityThread.handleSendResult(ActivityThread.java:5085) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:140) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2080) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:264) at android.app.ActivityThread.main(ActivityThread.java:7581) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
How to repeat issue and example
- Not reproducible every-time. Seems Random crash being received.
Solution
Additional Information
- Image Picker version: ^4.0.4
- React Native version: ^0.64.1
- Platform: Android
- Development Operating System: Mac OS
- Dev tools: Android Studio
same issue !
Can you replicate it with the example app?
I'm not facing this issue always. Getting it on Crashlytics.
facing same issue. crashing after selecting an image
Any update on this issue?
Possible duplicate of https://github.com/react-native-image-picker/react-native-image-picker/issues/713
It's happening with me when I tap multiple times on the button and I don't have the default gallery app defined! I've tried to apply a solution that I found in another issue but with no success (using ref).
to replay:
- multiple taps on the button that calls the function
- after appearing "Choose an action", cancel all of them (tapping out side the box)
- the app will crash
...
const handleSelectProfilePicture = () => {
if (isPickerOpen.current) return;
isPickerOpen.current = true;
try {
const imageResult = launchImageLibrary({ mediaType: 'photo' }, () => {
isPickerOpen.current = false;
});
...
}
...
<TouchableOpacity
activeOpacity={1.0}
onPress={handleSelectProfilePicture}
>
...

any updates?
any updates ?