该函数在执行时崩溃,但在开发模式下运行正常。
我正在使用Expo SDK,我需要从相机应用中拍照
takePhoto = async () => {
const status = await Permissions.askAsync(Permissions.CAMERA, Permissions.CAMERA_ROLL);
const result = await ImagePicker.launchCameraAsync({
allowsEditing: true,
aspect: [4, 3],
// base64: true
});
if (!result.cancelled && result.type === 'image') {
this.setState({ image: result.uri, bottomsheet: false })
}
console.log(result);
}
我希望摄像头应用能够正常运行,但是我重启了该应用:s