HarmonyOS鸿蒙Next中使用了@ohos.data.intelligence (智慧数据平台)里的接口intelligence.getImageEmbeddingModel,但是报这个错误The default system capabilities of de

HarmonyOS鸿蒙Next中使用了@ohos.data.intelligence (智慧数据平台)里的接口intelligence.getImageEmbeddingModel,但是报这个错误The default system capabilities of de 【问题描述】:

我是用了@ohos.data.intelligence (智慧数据平台)里的接口intelligence.getImageEmbeddingModel,但是报这个错误The default system capabilities of devices phone do not include SystemCapability.DistributedDataManager.DataIntelligence.Core. Configure the capabilities in syscap.json. <ArkTSCheck>

我在项目根路径下创建了syscap.json文件,内容:

{
  "devices": {
    "general": [
      "phone"
    ]
  },
  "development": {
    "addedSysCaps": [
      "SystemCapability.DistributedDataManager.DataIntelligence.Core"
    ]
  }
}

【问题现象】:这个错误The default system capabilities of devices phone do not include SystemCapability.DistributedDataManager.DataIntelligence.Core. Configure the capabilities in syscap.json. <ArkTSCheck>

【版本信息】:5.1.1‘api19


更多关于HarmonyOS鸿蒙Next中使用了@ohos.data.intelligence (智慧数据平台)里的接口intelligence.getImageEmbeddingModel,但是报这个错误The default system capabilities of de的实战教程也可以访问 https://www.itying.com/category-93-b0.html

3 回复

智慧数据平台(ArkData Intelligence Platform,AIP)提供端侧数据智慧化构建,使应用数据向量化,通过嵌入模型将非结构化的文本、图像等多模态数据,转换成具有语义的向量。

本模块首批接口从API version 15开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。

考虑到数据向量化处理的计算量和资源占用较大,当前仅支持在2in1设备上使用。

更多关于HarmonyOS鸿蒙Next中使用了@ohos.data.intelligence (智慧数据平台)里的接口intelligence.getImageEmbeddingModel,但是报这个错误The default system capabilities of de的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


该错误表明设备未启用智慧数据平台的默认系统能力。在HarmonyOS Next中,@ohos.data.intelligence模块需要特定的系统能力支持。请检查设备的系统能力列表,确认是否包含SystemCapability.AI.Intelligence.Data。若未包含,则当前设备不支持此接口,需更换具备该能力的设备进行开发或测试。

这个错误表明你的应用在编译时,ArkTS编译器(ArkTSCheck)检测到你使用了SystemCapability.DistributedDataManager.DataIntelligence.Core这个系统能力,但该能力并未包含在你当前配置的phone设备的默认能力集中。

你已经在syscap.json文件的development.addedSysCaps字段中声明了该能力,这是正确的步骤。问题很可能出在配置文件的位置格式上。

请按以下步骤检查和修正:

  1. 确认文件位置syscap.json文件必须放在项目的根目录下(与entryoh-package.json等文件同级)。请再次确认文件路径是否正确。

  2. 检查JSON格式:你提供的JSON内容在结构上是正确的。但请确保文件没有隐藏的格式错误,例如:

    • BOM头:使用纯文本编辑器(如VS Code)打开文件,确保保存为无BOM的UTF-8格式。
    • 尾部逗号:检查最后一个数组或对象元素后是否有多余的逗号。
    • 引号:确保所有键名和字符串值都使用了双引号。
  3. 验证配置文件是否生效

    • 执行一次Clean Project(通常位于菜单栏的 Build -> Clean Project)。
    • 然后执行 Rebuild ProjectBuild -> Rebuild Project)。
    • 重新编译后,检查错误是否仍然存在。
  4. 检查API版本兼容性:你使用的API版本是5.1.1 (api19)。请查阅HarmonyOS官方文档,确认@ohos.data.intelligence模块以及SystemCapability.DistributedDataManager.DataIntelligence.Core这个系统能力在API 9上是否已经可用。系统能力可能从特定的API版本开始才被支持。

总结:问题根源是你的syscap.json配置文件未被编译器正确识别。优先排查文件位置和格式,执行清理和重建操作。如果问题依旧,需核实该能力在你目标API版本上的支持情况。

回到顶部