运行到手机时
- 发布:2026-01-10 14:05
- 更新:2026-01-10 14:56
- 阅读:65
产品分类: uniapp/App
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: 26.2 (25C56)
HBuilderX类型: 正式
HBuilderX版本号: 4.87
手机系统: HarmonyOS NEXT
手机系统版本号: HarmonyOS 6.0.0
手机厂商: 华为
手机机型: pura70
页面类型: vue
vue版本: vue3
打包方式: 离线
项目创建方式: HBuilderX
操作步骤:
预期结果:
运行正常
运行正常
实际结果:
报错Error Message: The struct name cannot contain reserved tag name: 'Picker'. At File: /Users/wucailong/Projects/uni-tools/unpackage/dist/dev/app-harmony/oh_modules/.ohpm/@dcloudio+uni-app-runtime@e61xy4t7udv6xbickvvkkdflr0p30afaiftcwqggq70=/oh_modules/@dcloudio/uni-app-runtime/src/main/ets/uni-mp-sdk/components/Picker.ets:112:15
13:47:53.251 2 ERROR: 10905227 ArkTS Compiler Error
13:47:53.251 Error Message: The struct 'Picker' cannot have the same name as the built-in component 'Picker'. At File: /Users/wucailong/Projects/uni-tools/unpackage/dist/dev/app-harmony/oh_modules/.ohpm/@dcloudio+uni-app-runtime@e61xy4t7udv6xbickvvkkdflr0p30afaiftcwqggq70=/oh_modules/@dcloudio/uni-app-runtime/src/main/ets/uni-mp-sdk/components/Picker.ets:112:14
13:47:53.252 COMPILE RESULT:FAIL {ERROR:3 WARN:639}
13:47:53.252 * Try:
13:47:53.252 > Run with --stacktrace option to get the stack trace.
13:47:53.252 > Run with --debug option to get more log output.
13:47:53.252 > hvigor ERROR: BUILD FAILED in 20 s 41 ms
13:47:53.616 运行包制作失败
报错Error Message: The struct name cannot contain reserved tag name: 'Picker'. At File: /Users/wucailong/Projects/uni-tools/unpackage/dist/dev/app-harmony/oh_modules/.ohpm/@dcloudio+uni-app-runtime@e61xy4t7udv6xbickvvkkdflr0p30afaiftcwqggq70=/oh_modules/@dcloudio/uni-app-runtime/src/main/ets/uni-mp-sdk/components/Picker.ets:112:15
13:47:53.251 2 ERROR: 10905227 ArkTS Compiler Error
13:47:53.251 Error Message: The struct 'Picker' cannot have the same name as the built-in component 'Picker'. At File: /Users/wucailong/Projects/uni-tools/unpackage/dist/dev/app-harmony/oh_modules/.ohpm/@dcloudio+uni-app-runtime@e61xy4t7udv6xbickvvkkdflr0p30afaiftcwqggq70=/oh_modules/@dcloudio/uni-app-runtime/src/main/ets/uni-mp-sdk/components/Picker.ets:112:14
13:47:53.252 COMPILE RESULT:FAIL {ERROR:3 WARN:639}
13:47:53.252 * Try:
13:47:53.252 > Run with --stacktrace option to get the stack trace.
13:47:53.252 > Run with --debug option to get more log output.
13:47:53.252 > hvigor ERROR: BUILD FAILED in 20 s 41 ms
13:47:53.616 运行包制作失败
bug描述:
运行到鸿蒙手机时,提示:Error Message: The struct name cannot contain reserved tag name: 'Picker'. At File: /Users/wucailong/Projects/uni-tools/unpackage/dist/dev/app-harmony/oh_modules/.ohpm/@dcloudio+uni-app-runtime@e61xy4t7udv6xbickvvkkdflr0p30afaiftcwqggq70=/oh_modules/@dcloudio/uni-app-runtime/src/main/ets/uni-mp-sdk/components/Picker.ets:112:15
13:47:53.251 2 ERROR: 10905227 ArkTS Compiler Error
13:47:53.251 Error Message: The struct 'Picker' cannot have the same name as the built-in component 'Picker'. At File: /Users/wucailong/Projects/uni-tools/unpackage/dist/dev/app-harmony/oh_modules/.ohpm/@dcloudio+uni-app-runtime@e61xy4t7udv6xbickvvkkdflr0p30afaiftcwqggq70=/oh_modules/@dcloudio/uni-app-runtime/src/main/ets/uni-mp-sdk/components/Picker.ets:112:14
13:47:53.252 COMPILE RESULT:FAIL {ERROR:3 WARN:639}
13:47:53.252 * Try:
13:47:53.252 > Run with --stacktrace option to get the stack trace.
13:47:53.252 > Run with --debug option to get more log output.
13:47:53.252 > hvigor ERROR: BUILD FAILED in 20 s 41 ms
13:47:53.616 运行包制作失败
该bug反馈内容基本完整,标题清晰描述了问题,错误信息详细提供了具体报错路径和编译器错误码,环境信息齐全(HBuilderX 4.87、HarmonyOS 6.0.0等)。但复现步骤过于简略(仅"运行到手机时"),缺少关键操作细节;未提供触发该问题的具体页面代码,不利于精准定位。
经分析,此bug成立且属于鸿蒙平台特有问题。错误提示"The struct 'Picker' cannot have the same name as the built-in component 'Picker'"表明uni-app的Picker组件与鸿蒙系统内置Picker组件存在命名冲突。知识库中4.36.2024112817版本日志显示团队已多次修复鸿蒙Picker组件问题(如mode="time"显示异常等),但当前HBuilderX 4.87版本仍存在此基础命名冲突。
根据鸿蒙开发规范,自定义组件禁止使用系统保留名称。建议用户:
- 升级至最新HBuilderX版本(检查是否有4.88+修复版本)
- 若需紧急解决,可尝试在
manifest.json中配置"transpiler": "babel"降级编译方案 - 避免在代码中直接引用
Picker组件,改用uni-app提供的替代方案如<view>+自定义选择器
此问题非概念性误报,属鸿蒙平台适配缺陷,需官方在底层运行时修改组件命名策略。