我的问题是我的应用程序在用yarn start或expo start测试它时,要求我提供摄像头权限以及使用其他电话凭据(例如指纹)的权限。但是,当我使用expo build:android生成apk时,在安装时它不会询问对资源的许可,并且在手机的应用程序信息中,它会通知我该应用程序未请求使用权限任何资源。
{
"expo": {
"name": "Page",
"slug": "Page",
"privacy": "public",
"sdkVersion": "34.0.0",
"platforms": [
"ios",
"android",
"web"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/5_5_R-icon.png",
"splash": {
"image": "./assets/splash1.png",
"resizeMode": "cover",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android":{
"permissions":["CAMERA_ROLL"],
"package":"com.ivanzapata.page"
}
}
}
答案 0 :(得分:1)
您在app.json中的权限必须是Android的权限名称,而不是博览会的名称。参见https://docs.expo.io/versions/latest/sdk/permissions/#android-permissions-equivalents-inside-appjson
所以您的app.json应该是
"android":{
"permissions":["READ_EXTERNAL_STORAGE", "WRITE_EXTERNAL_STORAGE"],
"package":"com.ivanzapata.page"
}