question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[🐛] didCancel : true, After selection of image from Gallery in Android.

See original GitHub issue

HI,

I have use the latest release package of the image picker. I have facing problem when pick image from the gallery, when i tap on my button I will see the gallery and photo app for selection, And after I choose the photo from the app, and check the response, there will be { didCancel : true }, i haven’t get the image object which is i have selected. In Camera it’s work perfect.

    launchImageLibrary(
      {
        mediaType: 'photo'
      },
      (response) => {
        console.log("=== response ==", response)
      },
    )

I have check on the imagePickerModule.java in which the status is different so that it will happen.

         if (resultCode != Activity.RESULT_OK) {
             if (requestCode == REQUEST_LAUNCH_IMAGE_CAPTURE) {
                 deleteFile(cameraCaptureURI, reactContext);
             }
             callback.invoke(getCancelMap());
             return;
         }

Android Version : 11 Phone : MI

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:19 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
iamadityaazcommented, Nov 24, 2021

Turn On your MIUI Optimization in Developer Option. It solved my issue.

2reactions
pongopay1commented, Aug 17, 2021

Please reset your device, it’s work fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[🐛] didCancel : true, After selection of image from Gallery in Android.
I have facing problem when pick image from the gallery, when i tap on my button I will see the gallery and photo...
Read more >
react-native-image-picker on Android 4.x - Stack Overflow
When i press Choose from Library or Take Picture it shows the Gallery or Camera but right away the completion function gets called...
Read more >
How to pick images from Camera & Gallery in React Native app
In the above code, we will open an Image picker as you Click on “chooseImage” and will show the selected image on the...
Read more >
@2hats/react-native-image-picker - npm package | Snyk
A React Native module that allows you to use native UI to select media from the device library or directly from the camera...
Read more >
react-native-image-picker.Response.didCancel JavaScript ...
openPicker() { const options = { title: 'Select Photo', storageOptions: { skipBackup: true, path: 'images', }, }; ImagePicker.showImagePicker(options ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found