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


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

相关推荐
不爱吃糖的程序媛3 小时前
从 0 到 1:react-native-transformer-text-input 鸿蒙化适配实录
react native·transformer·harmonyos
不爱吃糖的程序媛3 小时前
React Native 三方库鸿蒙适配实战:react-native-emoji-popup(Fabric 自定义组件)从 0 到 1
react native·harmonyos·fabric
贾伟康3 小时前
【口算王|19】HarmonyOS ArkTS 回归测试实战:覆盖启动、空数据、异常输入和重复点击
软件测试·harmonyos·arkts·回归测试·hypium
贾伟康3 小时前
【句匠|09】HarmonyOS ArkTS 学习统计实战:汇总正确率、连续学习和薄弱类型
harmonyos·arkts·appstorage·学习统计·本地统计
贾伟康3 小时前
【口算王|17】HarmonyOS ArkTS 亮暗色与视觉令牌实战:集中颜色、间距和交互状态避免页面割裂
harmonyos·arkts·arkui·深色模式·ui设计
搬砖的kk4 小时前
从 0 到 1:react-native-screenshot-aware 鸿蒙适配实战(RNOH 0.84)
react native·华为·harmonyos
贾伟康4 小时前
【口算王|15】HarmonyOS ArkTS 本地状态持久化实战:让保存、删除和页面返回后的数据即时一致
harmonyos·arkts·数据持久化·状态管理·preferences
贾伟康4 小时前
【口算王|18】HarmonyOS ArkTS 权限与隐私实战:让 module.json5、功能说明和拒绝路径一致
harmonyos·arkts·权限管理·隐私合规·module.json5
ChinaDragonDreamer4 小时前
HarmonyOS:6.0 新增和增强特性
harmonyos·鸿蒙
Georgewu4 小时前
【HarmonyOS AI】 通用文字识别详解
harmonyos