OpenHarmony开发者论坛
标题:
Failure[MSG_ERR_INSTALL_GRANT_REQUEST_PERMISSIONS_FAILED]报错如何解决
[打印本页]
作者:
qq_43101295
时间:
2023-10-23 17:10
标题:
Failure[MSG_ERR_INSTALL_GRANT_REQUEST_PERMISSIONS_FAILED]报错如何解决
[md]权限中只有ohos.permission.MANAGE_AUDIO_CONFIG,ohos.permission.SYSTEM.FLOAT.WINDOWS为system_basic级权限,我已按照网上的在UnsgnedReleasedProfileTemplate.json中添加在acl字段中并没有解决这个问题
![a9bb671f641663b25d88e53a13c9901.png](data/attachment/forum/202310/23/170819vspw8uculeacycvh.png "a9bb671f641663b25d88e53a13c9901.png")
![6f11ec84f4370428d22dc35ab5d8e69.png](data/attachment/forum/202310/23/170901c3ywy1yz5bf4n41z.png "6f11ec84f4370428d22dc35ab5d8e69.png")
![image.png](data/attachment/forum/202310/23/170946d6vreeyn9e9yxe6e.png "image.png")
[/md]
作者:
论坛小助手
时间:
2023-10-25 14:24
[md]您具体是在什么场景使用?您在应用里的module.json5里写了哪些呢?
[/md]
作者:
qq_43101295
时间:
2023-10-25 17:16
回复
论坛小助手
:
{
"module": {
"name": "entry",
"type": "entry",
"description": "$string:module_desc",
"mainElement": "EntryAbility",
"deviceTypes": [
"default",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"abilities": [
{
"name": "EntryAbility",
"srcEntry": "./ets/entryability/EntryAbility.ts",
"description": "$string:EntryAbility_desc",
"icon": "$media:icon",
"label": "$string:EntryAbility_label",
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:start_window_background",
"minWindowHeight": 640,
"minWindowWidth": 360,
"exported": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
],
"requestPermissions": [
{
"name": "ohos.permission.MICROPHONE",
"reason": "$string:MICROPHONE"
},
{
"name": "ohos.permission.INTERNET",
"reason": "$string:INTERNET"
},
{
"name": "ohos.permission.GET_WIFI_INFO",
"reason": "$string:GET_WIFI_INFO"
},
{
"name": "ohos.permission.MANAGE_AUDIO_CONFIG",
"reason": "$string:MANAGE_AUDIO_CONFIG"
},
{
"name": "ohos.permission.SYSTEM_FLOAT_WINDOW",
"reason": "$string:SYSTEM_FLOAT_WINDOW",
"usedScene": {
"abilities": [
"EntryAbility"
],
"when": "inuse"
}
}
]
}
}
复制代码
作者:
论坛小助手
时间:
2023-10-26 10:00
回复
qq_43101295
: 要确保两件事情:
1、您修改的json文件,确实是用于签名的json文件,因为sdk可能有不同版本,json文件也有多份。
确认方法:devEco里左上角,File里settings里,搜索一下hvigor,把use log level勾选至debug,点击OK退出。Build下拉菜单里,点击Clean Project之后重新打包安装,在devEco输出日志里搜索hap-sign-tool.jar,看下用到的签名工具的jar包路径,在同级目录下就有对应的json文件。
2、这个module.json文件里requestPermissions里申请的权限都要在json文件里写,一个也不能少。
可以先确认2,实在不行再确认1,1稍微复杂点。
欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/)
Powered by Discuz! X3.5