鴻蒙OS應用開發之——This device type does not match the module profile
阿新 • • 發佈:2020-12-21
技術標籤:HarmonyOS
一 現象
執行專案到裝置時,會出現錯誤,資訊如下
This device type does not match the module profile.
Error while Deploying HAP
二 原因
config.json
中裝置欄位配置與裝置不匹配(裝置要求執行到phone(手機)上,實際執行到其他裝置上)
"deviceType": [
"phone"
],
三 解決辦法
3.1 deviceType可供選擇型別
屬性名稱 | 含義 | 資料型別 | 是否可預設 |
---|---|---|---|
default | 表示所有裝置通用的應用配置資訊 | 物件 | 否 |
phone | 表示手機類裝置的應用資訊配置 | 物件 | 可預設,預設為空 |
tablet | 表示平板的應用配置資訊 | 物件 | 可預設,預設為空 |
tv | 表示智慧屏特有的應用配置資訊 | 物件 | 可預設,預設為空 |
car | 表示車機特有的應用配置資訊 | 物件 | 可預設,預設為空 |
wearable | 表示智慧穿戴特有的應用配置資訊 | 物件 | 可預設,預設為空 |
liteWearable | 表示輕量級智慧穿戴特有的應用配置資訊 | 物件 | 可預設,預設為空 |
smartVision | 表示智慧攝像頭特有的應用配置資訊 | 物件 | 可預設,預設為空 |
2.2 修改或新增deviceType(適配手機和平板)
"deviceType": [ "phone","tablet" ],