1***@163.com
1***@163.com
  • 发布:2025-05-26 15:37
  • 更新:2025-05-26 15:50
  • 阅读:84

鸿蒙:Detail: Make sure the module.type field is set correctly in the module.json5 file

分类:鸿蒙Next

配置鸿蒙权限,首先harmony-configs是一个空文件夹,我自己根据uniapp文档创建了harmony-configs/entry/src/main/module.json5文件夹及文件,module.json5配置内容如下:
{
"module":{
"requestPermissions":[
{
"name" : "ohos.permission.CAMERA",
"reason": "$string:photograph",
"usedScene": {
"abilities": [
"FormAbility"
],
"when":"inuse"
}
}
]
}
}

然后真机运行就报 Detail: Make sure the module.type field is set correctly in the module.json5 file:,这是怎么回事啊

2025-05-26 15:37 负责人:无 分享
已邀请:
DCloud_UNI_yuhe

DCloud_UNI_yuhe

你在这个位置放配置文件,得把文件放完整了,它是会覆盖到鸿蒙工程的

  • 1***@163.com (作者)

    有没有完整的案例,这个地方都需要放什么东西啊

    2025-05-26 15:55

  • DCloud_UNI_yuhe

    回复 1***@163.com: 这个你得去看鸿蒙文档,鸿蒙工程中放什么,这个地方就放什么

    2025-05-26 15:57

  • 1***@163.com (作者)

    回复 DCloud_UNI_yuhe: 麻烦在问一下是整个harmony-configs文件夹还是只是module.json5文件

    2025-05-26 15:59

要回复问题请先登录注册