修改 app id - 鸿蒙 HarmonyOS Next

修改项目 app id 后通过真机 build run 的时候抛出了如下异常;

项目中更改后的配置与真机的不匹配;

TypeScript 复制代码
{
  app: {
    bundleName: "com.xxxxxx.xxx_harmony",
    vendor: "xxxxxx",
    versionCode: 1,
    versionName: "3.5.00",
    icon: "$media:app_icon",
    label: "$string:app_name",
  },
}

修改后直接 build 可能会抛出如下异常:

需重新配置下签名即可

复制代码
Open the project-level build-profile.json5 file. Change the bundleName value to that in the SigningConfigs. Otherwise, go to the app.json5 file and change the bundleName value there.
BundleName in Project: com.xxxxxx.xxx_harmony, BundleName in SigningConfigs: com.example.xxx_harmony.

解决办法

重新配置签名方式如下:

将现有 build-profile.json5 中的 signingConfigs 清空;

重新 new 新的配置后, Run 即可


以上便是此次分享的全部内容,希望能对大家有所帮助!

相关推荐
lmy_loveF1 小时前
构建第一个HarmonyOS元服务
华为·harmonyos
哦***71 小时前
鸿蒙小知识 | 华为耳机双击没法暂停音乐?
华为·音频·harmonyos
木木子2214 小时前
# 鸿蒙 ArkTS 实战:秒表 Stopwatch(示例 5)
数据结构·华为·list·harmonyos
zdj_develop14 小时前
鸿蒙应用开发实战(一):应用程序包概述
华为·harmonyos
智塑未来16 小时前
鸿蒙更智能:从“人找App”到“意图即服务”
华为·harmonyos
qizayaoshuap19 小时前
鸿蒙 ArkTS 实战:数据存储 Preferences 本地持久化(示例 95)
华为·harmonyos
木木子2219 小时前
HarmonyOS NEXT 折叠面板与Step组件实战开发
华为·harmonyos
程序员黑豆20 小时前
鸿蒙应用开发:AppStorage 全局状态存储用法教程
前端·harmonyos
梦想不只是梦与想21 小时前
鸿蒙性能优化:启动速度
性能优化·harmonyos·启动速度