使用expo构建Android应用程序时的摄像头权限消息:构建



当我在expo应用程序中测试我的应用程序时,一切都正常。

当我使用expo build:android构建Android二进制文件时,相机和相机滚动停止工作。我收到了许可消息,我授予了访问权限,但什么也没发生。

我正在使用这个代码,并且总是得到"批准"。

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);
});
}

我正在使用exposdk30。

使用adb-logcat,我发现了以下行:

11-01 14:17:14.111 3019 3092 I ReactNativeJS:"camera",{error:{〔error:User rejected permissions〕framesToPop:1,code:"EUNSPECIFIED"}}

但是,在android设置->应用程序->我的应用程序中,所有权限都被授予。

经过大量搜索,解决方案是从App.json中删除所有权限。

最新更新