目录

ASCF转换的元服务在模拟器上运行失败

问题现象

通过ASCF框架将小程序转化成元服务,在模拟器上运行失败,详细错误如下:

Install Failed: error: failed to install bundle.
code:9568305
error: Failed to install the HAP or HSP because the dependent module does not exist.

解决方案

  1. 低版本模拟器中缺少ASCF运行时:

    执行命令hdc shell bm dump-shared -n com.huawei.hms.ascfruntime,缺少ASCF运行时导致查询失败,需要创建API 19及以上版本的模拟器。

  2. 元服务依赖的ASCF运行时版本与模拟器中运行时版本不匹配:

    模拟器中的ASCF运行时,是不能安装和升级的,所以元服务依赖的运行时版本号不能高于模拟器中预置的版本号。执行命令hdc shell bm dump-shared -n com.huawei.hms.ascfruntime查询模拟器ASCF运行时版本,例如本次查询的版本号为“1.0.15.300”,则需要将entry/oh-package.json5配置文件中"@atomicservice/ascfapi"的版本号改为“1.0.15”,注意版本号前面不要加“^”。