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


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

相关推荐
ICT系统集成阿祥1 小时前
小型企业WIFI配置方案,附华为企业 WiFi 完整配置案例!
华为
晚霞的不甘2 小时前
HarmonyOS ArkTS 进阶实战:深入理解边距、边框与嵌套布局
前端·计算机视觉·华为·智能手机·harmonyos
国医中兴3 小时前
ClickHouse数据导入导出最佳实践:从性能到可靠性
flutter·harmonyos·鸿蒙·openharmony
国医中兴3 小时前
大数据处理的性能优化技巧:从理论到实践
flutter·harmonyos·鸿蒙·openharmony
常利兵5 小时前
从0到1,解锁Android WebView混合开发新姿势
android·华为·harmonyos
Francek Chen6 小时前
【华为春季全场景新品发布会】2026春季新品发布:万物互联,智启未来
华为·harmonyos·mate80·鸿蒙6
●VON6 小时前
Flutter组件深度解析:从基础到高级的完整指南
android·javascript·flutter·harmonyos·von
讯方洋哥6 小时前
HarmonyOS App开发——鸿蒙ArkTS的ibestUI在鸿蒙PC集成和应用
harmonyos
国医中兴6 小时前
ClickHouse集群部署与管理:从0到1的实战指南
flutter·harmonyos·鸿蒙·openharmony