ImagePicker.launchCameraAsync does not start on some devices

#1

Sorry for my english.

I have:

async addPhoto() {
    const response = await Permissions.askAsync(Permissions.CAMERA);
    console.log(response);
    console.log('launch camera3');
    console.log(ImagePicker);
    const result = ImagePicker.launchCameraAsync({
      allowsEditing: false, // also true
      aspect: [4, 3],
      base64: false, // also true
      quality: 1,
    });

    console.log('launch camera1');
    console.log(await result);

    if (!result.cancelled) {
      this.changePhoto(result.uri);
    }
  }

Permission:

Object {expires: "never", status: "granted"}

But after ‘launch camera1’ camera doesn’t launch (one samsung launch, one not, 50/50). Await before ImagePicker does`t help. launchImageLibraryAsync works good on the same deviсes. What can I do?

https://snack.expo.io/HJ2aKjTcW

Thanks for help

#2

Code nit: Is ImagePicker.launchCameraAsync({}) returning a function? If so you should use await result() instead of await result

I will share this issue internally with people working on the Camera API and see if they can provide some guidance.

#3
console.log(result)
Promise {_40: 0, _65: 0, _55: null, _72: null}

Possible Unhandled Promise Rejection (id: 0):
TypeError: result is not a function
TypeError: result is not a function
    at Object.addPhoto$

ImagePicker.launchCameraAsync({}) return Promise, if await result() - error.
In guide await before ImagePicker.launchCameraAsync({}), but in this scenario don`t see ‘launch camera1’

issue - https://github.com/expo/expo/issues/627

#4

I’ve pinged @nikki who may be able to help you a little more here.

#5

@kazik @jimmylee What’s the solution here? I’ve got the same problem.

#6

Where you able to solve the problem? @trunkbot

#7

problem solved:
In addtion to CAMERA permission you have to also add CAMERA_ROLL permission.

await Permissions.askAsync(Permissions.CAMERA);
await Permissions.askAsync(Permissions.CAMERA_ROLL);

I think most people like myself add CAMERA but forget to add CAMERA_ROLL.