/harmony-configs/entry/src/main/module.json5 配置完,打包报错
"requestPermissions": [
{
"name": "ohos.permission.INTERNET"
},
{
"name": "ohos.permission.SHORT_TERM_WRITE_IMAGEVIDEO"
},
{
"name": "ohos.permission.READ_IMAGEVIDEO"
}
]
[HBuilder] 11:09:28.615 > hvigor WARN: The project has not explicitly set the 'targetSdkVersion' version at build-profile.json5. It is recommended to configure it. Reference: https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/ide-hvigor-build-profile-app#section45865492619
[HBuilder] 11:09:28.615 > hvigor ERROR: Failed :entry:default@PreBuild...
[HBuilder] 11:09:28.615 > hvigor ERROR: 00303218 Configuration Error
[HBuilder] 11:09:28.615 Error Message: The reason and usedScene attributes are mandatory for user_grant permissions.
[HBuilder] 11:09:28.615 at D:\code\lxzm\lm-uniapp\unpackage\dist\build\app-harmony\entry\src\main\module.json5
[HBuilder] 11:09:28.615 Try the following:
[HBuilder] 11:09:28.615 > For the hap module, add the reason and usedScene fields to the permission reported in the preceding file.
[HBuilder] 11:09:28.615 > For the har/hsp module, add the reason field to the permission of the error information in the preceding file.
[HBuilder] 11:09:28.615 Try:
[HBuilder] 11:09:28.615 > Run with --stacktrace option to get the stack trace.
[HBuilder] 11:09:28.615 > Run with --debug option to get more log output.
[HBuilder] 11:09:28.615 > hvigor ERROR: BUILD FAILED in 1 s 272 ms
[HBuilder] 11:09:29.132 安装包制作失败
3 个回复
Ask小助手
这个问题是由于鸿蒙上架时检测到应用实际请求的
user_grant类型权限(如位置、通知等需用户授权的权限)与隐私政策中声明的权限不一致导致的。解决方案:
requestPermissions权限(特别是user_grant类型)/harmony-configs/entry/src/main/module.json5文件的requestPermissions节点中正确声明所有使用的权限特别注意:
参考文档:
鸿蒙权限配置指南
隐私协议自查指南
l***@163.com (作者)
/harmony-configs/entry/src/main/module.json5 配置完,打包报错
[HBuilder] 11:09:28.615 > hvigor WARN: The project has not explicitly set the 'targetSdkVersion' version at build-profile.json5. It is recommended to configure it. Reference: https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/ide-hvigor-build-profile-app#section45865492619
[HBuilder] 11:09:28.615 > hvigor ERROR: Failed :entry:default@PreBuild...
[HBuilder] 11:09:28.615 > hvigor ERROR: 00303218 Configuration Error
[HBuilder] 11:09:28.615 Error Message: The reason and usedScene attributes are mandatory for user_grant permissions.
[HBuilder] 11:09:28.615 at D:\code\lxzm\lm-uniapp\unpackage\dist\build\app-harmony\entry\src\main\module.json5
[HBuilder] 11:09:28.615 Try the following:
[HBuilder] 11:09:28.615 > For the hap module, add the reason and usedScene fields to the permission reported in the preceding file.
[HBuilder] 11:09:28.615 > For the har/hsp module, add the reason field to the permission of the error information in the preceding file.
[HBuilder] 11:09:28.615 Try:
[HBuilder] 11:09:28.615 > Run with --stacktrace option to get the stack trace.
[HBuilder] 11:09:28.615 > Run with --debug option to get more log output.
[HBuilder] 11:09:28.615 > hvigor ERROR: BUILD FAILED in 1 s 272 ms
[HBuilder] 11:09:29.132 安装包制作失败
l***@163.com (作者)
https://bbs.itying.com/topic/68fa84c73b9d2e00410b4301
这里的方法也没生效
要回复问题请先登录或注册
公告
更多>相关问题