react-native-image-crop-picker: ImagePicker.openPicker crashs the app when calling it more than once

I think this might be related to #275, but since there’s still no solutions (and it is for android, mine is ios), I’d like to open this issue.

Note: I do have finish the README file for many times, and follow all the install guides. My ios dependencies are installed by pod.

Version

  • react-native-image-crop-picker v0.19.1
  • react-native v0.49.3

Platform

  • iOS 11.2

Expected behaviour

After Picker close, it can be open again. (It DO work as expect in my Android devices)

Actual behaviour

When I close the Picker, and call ImagePicker.openPicker on the 2nd time:

  1. The Picker shows for a second, then disapper
  2. After that, the app becomes unclickable, even I refresh it by Reload scripts
  3. I have to kill it and restart the app to make it work again

Steps to reproduce

// in some button press event
    try {
      image = await ImagePicker.openPicker({});
    } catch (err) {
      console.log(err)
    }

Attachments

There are no errors catch by RN code, so I don’t have any error log. It just happens.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (1 by maintainers)

Most upvoted comments

@hkxicor easy

setTimeout(() => {
      ImagePicker.openCamera({
        width: 300,
        height: 300,
        cropping: true,
        includeBase64: true
      }).then((imageObj) => {
        const res = {
          uri: imageObj.path,
          data: imageObj.data
        }
        this.onGetImageResponse(res)
      })
      .catch((error) => {
        console.log('onTakePhotoPress error')
        console.log(error)
      })
    }, 100)