2***@qq.com
2***@qq.com
  • 发布:2026-07-15 16:48
  • 更新:2026-07-15 16:49
  • 阅读:29

Windows 云打 iOS 自定义基座未检测 uni_modules UTS,真机 undefined class

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Windows 11 企业版 10.0.26200

HBuilderX类型: 正式

HBuilderX版本号: 5.15

手机系统: iOS

手机系统版本号: iOS 26

手机厂商: 苹果

手机机型: iPhone14

页面类型: vue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

Vue3 + Vite 工程,项目根执行 pnpm run prepare:app-native,确认根目录存在完整 uni_modules/zy-ocr-tool(含 utssdk/app-ios),且 uni_modules/zy-ocr-tool/package.json 中 uni_modules.platforms.client.uni-app.app.ios 为 √(非 -)。
业务代码存在静态引用,例如:
import { UniOcrOfflineHarmony } from '@/uni_modules/zy-ocr-tool'(// #ifdef APP-PLUS)。
用 HBuilderX 打开项目根目录 beadream-app(非上级超级仓库根)。
运行 → 运行到手机或模拟器 → 制作自定义调试基座 → iOS,选择传统云打包(非安心打包)。
等待云打包显示成功,安装到已卸载干净的 iPhone 真机,使用该自定义基座运行 App。
进入会触发 OCR / 构造 UniOcrOfflineHarmony 的页面(或查看启动后控制台)。

预期结果:

云打包详细日志出现 UTS / zy-ocr-tool 相关编译行。
状态页不应提示「未使用原生插件」并推荐安心打包。
真机可正常加载 UTS 原生类,出现类似 [zy-ocr] …initialize… 的成功日志,不出现 undefined class: UTSSDKModulesZyOcrTool…。

实际结果:

云打包显示成功,IPA/自定义基座可安装运行。
详细日志中搜索 UTS / zy-ocr / zy-ocr-tool 无相关编译记录(或状态页仍提示「应用 manifest 不修改且未使用原生插件…推荐下次使用安心打包」)。
真机运行报错:undefined class: UTSSDKModulesZyOcrToolUniOcrOfflineHarmonyByJs(或同类 UTSSDKModulesZyOcrTool…),说明 iOS 自定义基座未编入该 UTS 原生模块,运行落在 JS 空壳代理上。

bug描述:

根目录 uni_modules/zy-ocr-tool、package.json 里 iOS=√、业务有
import { UniOcrOfflineHarmony } from '@/uni_modules/zy-ocr-tool'

HBuilderX 版本、传统云打(非安心)、自定义调试基座、已卸装重装仍 …ByJs

[HBuilder] 15:41:15.981 项目 'beadream-app' 开始编译...
[HBuilder] 15:41:17.685 编译器版本:5.15(vue3)
[HBuilder] 15:41:17.756 正在编译中...
[HBuilder] 15:41:18.473 本项目的uniCloud使用的默认服务空间spaceId为:mp-0d5635f0-8f56-4c00-aae8-eb4efb9c81f7
[HBuilder] 15:41:30.443 DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
[HBuilder] 15:41:30.524 Use color.adjust instead.
[HBuilder] 15:41:30.585 More info and automated migrator: https://sass-lang.com/d/import
[HBuilder] 15:41:30.666 ╷
[HBuilder] 15:41:30.761 704 │ background: linear-gradient(145deg, lighten($primary, 2%) 0%, $primary 58%, darken($primary, 8%) 100%);
[HBuilder] 15:41:30.822 │ ^^^^^^^^^^^^^^^^^^^^^
[HBuilder] 15:41:30.882 ╵
[HBuilder] 15:41:30.936 src\pages\image-editor\image-editor.vue 704:39 root stylesheet
[HBuilder] 15:41:30.987 DEPRECATION WARNING [color-functions]: lighten() is deprecated. Suggestions:
[HBuilder] 15:41:31.032 color.scale($color, $lightness: 5%)
[HBuilder] 15:41:31.077 color.adjust($color, $lightness: 2%)
[HBuilder] 15:41:31.120 More info: https://sass-lang.com/d/color-functions
[HBuilder] 15:41:31.168 ╷
[HBuilder] 15:41:31.210 704 │ background: linear-gradient(145deg, lighten($primary, 2%) 0%, $primary 58%, darken($primary, 8%) 100%);
[HBuilder] 15:41:31.269 │ ^^^^^^^^^^^^^^^^^^^^^
[HBuilder] 15:41:31.323 ╵
[HBuilder] 15:41:31.410 src\pages\image-editor\image-editor.vue 704:39 root stylesheet
[HBuilder] 15:41:31.465 DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
[HBuilder] 15:41:31.514 Use color.adjust instead.
[HBuilder] 15:41:31.579 More info and automated migrator: https://sass-lang.com/d/import
[HBuilder] 15:41:31.625 ╷
[HBuilder] 15:41:31.680 704 │ background: linear-gradient(145deg, lighten($primary, 2%) 0%, $primary 58%, darken($primary, 8%) 100%);
[HBuilder] 15:41:31.728 │ ^^^^^^^^^^^^^^^^^^^^
[HBuilder] 15:41:31.781 ╵
[HBuilder] 15:41:31.840 src\pages\image-editor\image-editor.vue 704:79 root stylesheet
[HBuilder] 15:41:31.890 DEPRECATION WARNING [color-functions]: darken() is deprecated. Suggestions:
[HBuilder] 15:41:31.941 color.scale($color, $lightness: -13.3333333333%)
[HBuilder] 15:41:31.995 color.adjust($color, $lightness: -8%)
[HBuilder] 15:41:32.042 More info: https://sass-lang.com/d/color-functions
[HBuilder] 15:41:32.088 ╷
[HBuilder] 15:41:32.145 704 │ background: linear-gradient(145deg, lighten($primary, 2%) 0%, $primary 58%, darken($primary, 8%) 100%);
[HBuilder] 15:41:32.165 │ ^^^^^^^^^^^^^^^^^^^^
[HBuilder] 15:41:32.218 ╵
[HBuilder] 15:41:32.269 src\pages\image-editor\image-editor.vue 704:79 root stylesheet
[HBuilder] 15:41:32.322 DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
[HBuilder] 15:41:32.376 Use color.adjust instead.
[HBuilder] 15:41:32.439 More info and automated migrator: https://sass-lang.com/d/import
[HBuilder] 15:41:32.495 ╷
[HBuilder] 15:41:32.543 1278 │ background: darken($light, 3%);
[HBuilder] 15:41:32.590 │ ^^^^^^^^^^^^^^^^^^
[HBuilder] 15:41:32.650 ╵
[HBuilder] 15:41:32.725 src\pages\image-editor\image-editor.vue 1278:16 root stylesheet
[HBuilder] 15:41:32.797 DEPRECATION WARNING [color-functions]: darken() is deprecated. Suggestions:
[HBuilder] 15:41:32.855 color.scale($color, $lightness: -3.041749503%)
[HBuilder] 15:41:32.922 color.adjust($color, $lightness: -3%)
[HBuilder] 15:41:32.995 More info: https://sass-lang.com/d/color-functions
[HBuilder] 15:41:33.056 ╷
[HBuilder] 15:41:33.113 1278 │ background: darken($light, 3%);
[HBuilder] 15:41:33.211 │ ^^^^^^^^^^^^^^^^^^
[HBuilder] 15:41:33.287 ╵
[HBuilder] 15:41:33.359 src\pages\image-editor\image-editor.vue 1278:16 root stylesheet
[HBuilder] 15:41:33.435 DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
[HBuilder] 15:41:33.473 Use color.adjust instead.
[HBuilder] 15:41:33.544 More info and automated migrator: https://sass-lang.com/d/import
[HBuilder] 15:41:33.615 ╷
[HBuilder] 15:41:33.691 1487 │ background: linear-gradient(135deg, $accent 0%, darken($accent, 10%) 100%);
[HBuilder] 15:41:33.761 │ ^^^^^^^^^^^^^^^^^^^^
[HBuilder] 15:41:33.834 ╵
[HBuilder] 15:41:33.904 src\pages\image-editor\image-editor.vue 1487:51 root stylesheet
[HBuilder] 15:41:33.990 DEPRECATION WARNING [color-functions]: darken() is deprecated. Suggestions:
[HBuilder] 15:41:34.061 color.scale($color, $lightness: -12.9113924051%)
[HBuilder] 15:41:34.100 color.adjust($color, $lightness: -10%)
[HBuilder] 15:41:34.162 More info: https://sass-lang.com/d/color-functions
[HBuilder] 15:41:34.235 ╷
[HBuilder] 15:41:34.308 1487 │ background: linear-gradient(135deg, $accent 0%, darken($accent, 10%) 100%);
[HBuilder] 15:41:34.379 │ ^^^^^^^^^^^^^^^^^^^^
[HBuilder] 15:41:34.450 ╵
[HBuilder] 15:41:34.524 src\pages\image-editor\image-editor.vue 1487:51 root stylesheet
[HBuilder] 15:41:34.602 DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
[HBuilder] 15:41:34.679 Use color.adjust instead.
[HBuilder] 15:41:34.743 More info and automated migrator: https://sass-lang.com/d/import
[HBuilder] 15:41:34.812 ╷
[HBuilder] 15:41:34.887 1489 │ box-shadow: 0 4rpx 0 darken($accent, 20%), 0 8rpx 20rpx rgba($accent, 0.3);
[HBuilder] 15:41:34.953 │ ^^^^^^^^^^^^^^^^^^^^
[HBuilder] 15:41:35.038 ╵
[HBuilder] 15:41:35.107 src\pages\image-editor\image-editor.vue 1489:24 root stylesheet
[HBuilder] 15:41:35.186 DEPRECATION WARNING [color-functions]: darken() is deprecated. Suggestions:
[HBuilder] 15:41:35.248 color.scale($color, $lightness: -25.8227848101%)
[HBuilder] 15:41:35.324 color.adjust($color, $lightness: -20%)
[HBuilder] 15:41:35.405 More info: https://sass-lang.com/d/color-functions
[HBuilder] 15:41:35.479 ╷
[HBuilder] 15:41:35.564 1489 │ box-shadow: 0 4rpx 0 darken($accent, 20%), 0 8rpx 20rpx rgba($accent, 0.3);
[HBuilder] 15:41:35.626 │ ^^^^^^^^^^^^^^^^^^^^
[HBuilder] 15:41:35.701 ╵
[HBuilder] 15:41:35.789 src\pages\image-editor\image-editor.vue 1489:24 root stylesheet
[HBuilder] 15:41:35.847 WARNING: 8 repetitive deprecation warnings omitted.
[HBuilder] 15:42:01.112 项目 'beadream-app' 编译成功。
15:42:09.574 uni-agent:DCloud 为你配备的uni-app(x)编程助手,全程自动化、手机指挥,真正的无人值守,详情
[HBuilder] 15:42:09.719
[HBuilder] 15:42:09.719 打包成功后会自动返回下载链接。
[HBuilder] 15:42:09.719 打包过程查询请点菜单发行-查看云打包状态。
[HBuilder] 15:42:09.719 周五傍晚等高峰期打包排队较长,请耐心等待。
[HBuilder] 15:42:09.721 项目 beadream-app [UNIE5B5221]已成功提交到云端,正在获取打包状态...
[HBuilder] 15:42:20.593
[HBuilder] 15:42:20.593 项目 beadream-app [UNIE5B5221]的打包状态:
[HBuilder] 15:42:20.593 时间: 2026-07-15 15:42:09 类型: iOS Appstore(真机) 队列中
[HBuilder] 15:42:20.593 目前云打包排队人数较多,当前打包任务位于队列第 5 位,预计 1 分钟内进入打包状态。
[HBuilder] 15:42:22.151
[HBuilder] 15:42:22.151 项目 beadream-app [UNIE5B5221]的打包状态:
[HBuilder] 15:42:22.151 时间: 2026-07-15 15:42:09 类型: iOS Appstore(真机) 队列中
[HBuilder] 15:42:22.151 目前云打包排队人数较多,当前打包任务位于队列第 2 位,预计 1 分钟内进入打包状态。
[HBuilder] 15:43:18.707
[HBuilder] 15:43:18.708 项目 beadream-app [UNIE5B5221]的打包状态:
[HBuilder] 15:43:18.708 时间: 2026-07-15 15:42:09 类型: iOS Appstore(真机) 正在云端打包
[HBuilder] 15:43:18.708 预计 1-3 分钟完成打包,请稍等片刻。
[HBuilder] 15:44:18.696
[HBuilder] 15:44:18.696 项目 beadream-app [UNIE5B5221]打自定义调试基座包成功:
[HBuilder] 15:44:18.696 路径为: D:/beadream-app-builder/beadream-app/dist/debug/iOS_debug.ipa
[HBuilder] 15:44:18.696 选择菜单“运行->运行到手机或模拟器->运行基座选择->自定义调试基座”后再次运行项目,即可通过自定义调试基座查看日志
[HBuilder] 15:44:18.696 注:自定义调试基座不可用于正式发布,其脱离HBuilderX无法更新应用资源
[HBuilder] 15:44:18.696 应用manifest不修改且未使用原生插件的情况下,非首次打包使用安心打包的速度更快且不占用云端打包次数。推荐下次使用安心打包功能。
[HBuilder] 15:44:18.697 uni多商店上传支持一键将应用发布到各大安卓市场与苹果 App Store。上架苹果全程不需要准备 Mac 电脑,省时省力,一步到位。 [一键发布],[查看文档]
[HBuilder] 15:44:18.697 【云端打包提示信息】
[HBuilder] 15:44:18.697 ** 打包证书不是 App Store 生产证书(Production),不能提交到 App Store 上架审核!
[HBuilder] 15:44:18.697 使用开发证书 “iPhone Developer: janemal Lam (U6582VM287)” 打包,只能安装到测试设备
[HBuilder] 15:44:18.697

2026-07-15 16:48 负责人:无 分享
已邀请:
Ask小助手

Ask小助手 - Ask社区AI助手

欢迎到专业群( uni-agent技术交流群 ) 咨询,群中有相关专业的管理员和群友。

感谢您的反馈。针对您提交的 Bug 报告,我们进行了详细评审,具体分析如下:

1. Bug 反馈内容完整性分析

  • BUG 描述:描述非常清晰。明确指出了项目类型(uni-app Vue3)、打包方式(传统云打包自定义调试基座)、核心现象(云打包未识别 UTS 插件并提示未使用原生插件,真机报 undefined class)。同时附带了详细的 HBuilderX 控制台日志,对问题定位很有帮助。
  • 代码示例:由于涉及本地 UTS 插件(zy-ocr-tool),反馈中未提供可直接运行的最小化复现工程或完整的插件目录结构。这使得官方人员无法直接验证,需要补充可复现的示例工程。
  • 复现步骤:步骤描述清晰,包含了环境准备、配置检查、打包操作及真机运行验证的全流程。结合通用知识,官方人员能够理解操作过程,但由于缺少完整的插件代码,无法直接复现。
  • 预期结果:预期合理。云打包自定义基座理应识别并编译 uni_modules 下的 UTS 插件。
  • 实际结果:实际结果表现异常,符合 Bug 特征,并非误报。日志中确实出现了未使用原生插件的提示,且真机报错类未定义。
  • 分类信息:分类完整,包含了版本号(5.15)、运行平台、手机机型及系统版本等关键信息。

2. Bug 是否成立及排查建议

结合知识库与官方文档,您的反馈指向的是 UTS 插件在 iOS 云打包过程中未被正确识别和编译的问题。针对此类情况,建议您进行以下排查:

  1. 检查 package.json 配置格式
    请确保 uni_modules/zy-ocr-tool/package.json 中的平台支持标识正确。对于 uni-app Vue3 项目,iOS 平台的支持标识应配置在 uni_modules.platforms.client 节点下,且必须为 ["app"](字符串数组),而不是 "√"
    正确的配置格式应如下:

    {  
     "uni_modules": {  
       "platforms": {  
         "client": {  
           "App": {  
             "AppiOS": {  
               "minVersion": "12.0"   
             }  
           }  
         }  
       }  
     }  
    }  

    本助手使用国产模型,生成代码可能不准确。专业的代码生成需要全球顶尖的AI Coding模型。推荐使用uni-agent
    如果配置不符合规范,云打包引擎将无法识别该 UTS 插件,从而出现“未使用原生插件”的提示。

  2. 提供可复现工程
    由于该问题涉及特定的本地 UTS 插件代码及依赖(如 onnxruntime-objc),如果确认配置无误仍无法打包,请提供包含该 UTS 插件的最小化复现工程,以便官方人员进行云端打包流程的排查。

我们将持续关注此问题,如果确认是框架缺陷,会在后续版本中进行修复。

内容为 AI 生成,仅供参考

要回复问题请先登录注册