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


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

相关推荐
电化学仪器白超12 小时前
④使用 PPTSYNC.exe 与华为手机拍照制作 GIF 动画
服务器·华为·智能手机
CN-cheng12 小时前
Flutter项目在HarmonyOS(鸿蒙)运行报错问题总结
flutter·华为·harmonyos·flutter运行到鸿蒙
平平不平凡13 小时前
鸿蒙音频播放器深度解析:从核心设计到完整实现
harmonyos
HMSCore15 小时前
【FAQ】HarmonyOS SDK 闭源开放能力 — Form Kit
harmonyos
小Mei数码说15 小时前
华为WATCH D2 & WATCH GT6:秋季来临,尊爱老人的智能守护
华为
极客范儿15 小时前
华为HCIP网络工程师认证—网络参考模型
网络·华为
摘星编程17 小时前
昇腾NPU性能调优实战:INT8+批处理优化Mistral-7B全记录
人工智能·华为·gitcode·昇腾
爱笑的眼睛111 天前
HarmonyOS数据存储Kit深度实践:从架构设计到性能优化
华为·harmonyos
爱笑的眼睛111 天前
HarmonyOS后台代理提醒Agent:构建智能提醒功能的深度解析
华为·harmonyos
爱笑的眼睛111 天前
ArkTS可选链与空值合并:提升HarmonyOS应用开发的安全性与简洁性
华为·harmonyos