修改 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 即可


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

相关推荐
OH_TPC1 小时前
lottie-turbo 源码解读(一):lottie_bridge 与 Animator——声明式配置到 native 渲染的桥接
harmonyos
钉先生贾2 小时前
HarmonyOS 7.0 空间计算实战 30:退出沉浸视图后,怎样清理临时资源并恢复上下文
华为·harmonyos·空间计算
钉先生贾4 小时前
HarmonyOS 7.0 空间计算实战 28:空间内容加载失败时,怎样提供可完成的二维替代
华为·harmonyos·空间计算
JosieBook4 小时前
【鸿蒙】把一个 Qt 桌面视频编辑器“搬“上鸿蒙 PC:Olive 移植适配全记录
qt·音视频·harmonyos
kirk_wang18 小时前
HarmonyOS 7 Text.tailIndents实战:停止条件换版后复核徽标如何不遮住正文
华为·harmonyos
kirk_wang1 天前
HarmonyOS 7 系统选色器实战:HdsColorPicker只管给色值,语义留给业务
华为·harmonyos
OH_TPC1 天前
ImageKnifePro 源码解读(五):Native 渲染节点与 ArkTS 组件——前台下单,后厨做菜
harmonyos
kirk_wang1 天前
HarmonyOS 7.0 AgentCard实战:随访草稿只到待确认,不替用户提交
华为·harmonyos
kirk_wang1 天前
HarmonyOS 7 智慧手势实战:requestSelected为什么不能当训练完成回执
华为·harmonyos
敲星写码1 天前
支持鸿蒙的远程控制软件有哪些?2026鸿蒙远控安装清单
华为·harmonyos