5

#鸿蒙 老项目装不上新设备,报错: INSTALL_PARSE_FAILED_USESDK_ERROR

 2 years ago
source link: https://xmanyou.com/harmony-os-install-parse-failed-usersdk-error/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
18 April 2021 / 鸿蒙

#鸿蒙 老项目装不上新设备,报错: INSTALL_PARSE_FAILED_USESDK_ERROR

网上下载了一个鸿蒙项目,在本地测试的时候,在一台设备上可以安装,而在另一台版本更新的设备上,却总是装不上。

看了一下DevEco运行时的错误,是

$ hdc shell bm install -p /sdcard/f77dae0261d749f2af3674f4d96eeba1/
Failure[INSTALL_PARSE_FAILED_USESDK_ERROR]
$ hdc shell rm -rf /sdcard/f77dae0261d749f2af3674f4d96eeba1
Error while Deploying HAP

harmony-os-INSTALL_PARSE_FAILED_USESDK_ERROR-01

从错误描述来看,应该是设备的版本和开发工具的sdk版本不一致导致的。

1. 终极解决方法

使用支持手机鸿蒙OS版本的最新的鸿蒙开发工具DevEco。

2. 临时解决方法

有时候,升级DevEco是不可取的,就只能用临时的解决方法:移除config.json中,releaseType字段。

    "apiVersion": {
      "compatible": 3,
      "target": 4,
      "releaseType": "Beta1" <--- 找到这一行,删除这一行,以及上一行的最后的逗号。
    }

harmony-os-INSTALL_PARSE_FAILED_USESDK_ERROR-02

再次运行,就可以安装上了。

阿斌

Read more posts by this author.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK