ImagePicker Camera Methods Not Working on App Reload but Works on App Start/Restart

#1

The following code that uses ImagePicker.launchImageLibraryAsync to get pictures from the camera roll does not work when “Reload” is selected from the app debug menu (the one that comes up when the phone is shaken). However, the code does work when I manually shut down the app and “Open on Android” in the Expo XDE. Is there a way to get it to work on “Reload” as well as start/restart? I am using a OnePlus 5 for development.

  getPictureFromCameraRoll = async () => {

    // this breakpoint is reached
    debugger;
    let result = await ImagePicker.launchImageLibraryAsync({
      allowsEditing: false,
      aspect: [4, 3],
      base64: true,
      exif: false
    });

    // this breakpoint is not reached when app is reloaded
    // it is only reached when the app is shut down and restarted
    debugger;
    console.log("picture added from camera roll ", result);
    if (!result.cancelled) {
      this.addPictures([result]);
    }
  };
1 Like
#2

Hey there, I’m not sure what’s going on but I’ve opened an issue to track this. Thanks for the report.