React native 使用expo:build构建Android应用程序时的摄像头权限消息
当我在expo应用程序中测试我的应用程序时,一切正常 当我使用expo build:Android构建Android二进制文件时,相机和相机滚轮停止工作。我收到了权限消息,我授予了访问权限,但什么也没发生 我使用这个代码,并且总是得到“批准”React native 使用expo:build构建Android应用程序时的摄像头权限消息,react-native,expo,React Native,Expo,当我在expo应用程序中测试我的应用程序时,一切正常 当我使用expo build:Android构建Android二进制文件时,相机和相机滚轮停止工作。我收到了权限消息,我授予了访问权限,但什么也没发生 我使用这个代码,并且总是得到“批准” if (status === "granted") { let image = await ImagePicker.launchCameraAsync({ mediaTypes: "Images", allowsEditing: tru
if (status === "granted") {
let image = await ImagePicker.launchCameraAsync({
mediaTypes: "Images",
allowsEditing: true,
aspect: [4, 3],
base64: true
}).catch(error => console.log(permissions, { error }));
this.setState({ editPhoto: image.uri });
ImageManipulator.manipulate(image.uri, [], {
base64: true,
compress: 0
}).then(img => {
ProfileStore.setBaseImage(img.base64);
});
}
我正在使用expo sdk 30
使用adb logcat,我发现了这一行:
11-01 14:17:14.111 3019 3092 I ReactNativeJS:'camera',{error:{[error:User-rejected permissions]framestoop:1,代码:'EUNSPECIFIED'}
但是,在android设置->应用->我的应用中,所有权限都被授予。经过大量搜索,解决方案是从App.json中删除所有权限。你救了我的命,我今天必须在截止日期之前交付我的应用,我花了一整天的时间试图解决这个难题。该应用程序现在要求所有世博会许可,这也是坏的,但至少相机现在工作。。。我希望这个问题能在新的世博会版本中得到解决