我的电脑是
macmini M2版本 MACOS 版本26.5.2
HBuilderX5.15
xcode26.6
SDK(UniAppX-iOS@5.15)
我按照官方文档下载了SDK,然后按照官方文档说明:uni-app x iOS版原生SDK进行配置,制作DCloudUTSExtAPI.xcframework(集成内置模块)
我的manifest.json文件
{
"id": "__UNI__**********",
"name": "****",
"description": "",
"version": {
"name": "1.0.0",
"code": "100"
},
"uni-app-x": {
"styleIsolationVersion": "2",
"compilerVersion": "5.15"
},
"app-ios": {
"distribute": {
"modules": {
"uni-barcode-scanning": {},
"uni-push": {},
"uni-prompt": {},
"uni-scanCode": {},
"uni-network": {},
"uni-clipboard": {},
"uni-getSystemInfo": {},
"uni-getAppAuthorizeSetting": {},
"uni-storage": {},
"uni-getDeviceInfo": {},
"uni-getAppBaseInfo": {},
"uni-websocket": {},
"uni-showLoading": {},
"uni-web-view": {},
"uni-fileSystemManager": {}
},
"icons": {},
"splashScreens": {}
},
"infoPlist": {
"NSUserNotificationUsageDescription": "需要通知权限用于接收消息推送"
}
}
}
按照文档说明:
Target -> General -> Minimum Deployments 选择 13.0
Target -> Build Settings -> Mach-O Type 设置为Dynamic Library
Target -> Build Settings -> Other Linker Flags 中添加-ObjC, 字母o和c大写
Target -> Build Settings -> Enable Module Verifier 设置为NO
Target -> Build Settings -> Build Libraries for Distribution 设置为YES
Target -> Build Settings -> Framework Search Paths 中添加SDK的Libs目录(操作方法:双击展开Framework Search Paths将SDK/Libs文件夹拖入即可)
对应模块进行依赖
源文件
依赖库
pod
源文件和依赖库均参考文档说明,按照manifest.json文件中的模块进行导入和依赖
AI还提示我检查源文件是否导入的验证方式
能够正常build xcframework了,但是主项目添加依赖后构建好的xcframework后,还是会出现报错:
真机:
dyld[1272]: Library not loaded: @rpath/FBLPromises.framework/FBLPromises
Referenced from: <7F811070-0022-3694-A212-79D6A5E8F1A3> /private/var/containers/Bundle/Application/667D94E3-3FAA-4E27-8C69-CDB18A2052F4/WiseIDC.app/Frameworks/DCloudUTSExtAPI.framework/DCloudUTSExtAPI
Reason: tried: '/usr/lib/swift/FBLPromises.framework/FBLPromises' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBLPromises.framework/FBLPromises' (no such file), '/private/var/containers/Bundle/Application/667D94E3-3FAA-4E27-8C69-CDB18A2052F4/WiseIDC.app/Frameworks/FBLPromises.framework/FBLPromises' (no such file), '/private/var/containers/Bundle/Application/667D94E3-3FAA-4E27-8C69-CDB18A2052F4/WiseIDC.app/Frameworks/DCloudUTSExtAPI.framework/Frameworks/FBLPromises.framework/FBLPromises' (no such file), '/private/var/containers/Bundle/Application/Frameworks/FBLPromises.framework/FBLPromises' (no such file), '/usr/lib/swift/FBLPromises.framework/FBLPromises' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBLPromises.framework/FBLPromises' (no such file), '/private/var/containers/Bundle/Application/667D94E3-3FAA-4E27-8C69-CDB18A2052F4/WiseIDC.app/Frameworks/FBLPromises.framework/FBLPromises' (no such file), '/private/var/containers/Bundle/Application/667D94E3-3FAA-4E27-8C69-CDB18A2052F4/WiseIDC.app/FBLPromises.framework/FBLPromises' (no such file), '/private/var/containers/Bundle/Application/667D94E3-3FAA-4E27-8C69-CDB18A2052F4/WiseIDC.app/Frameworks/FBLPromises.framework/FBLPromises' (no such file), '/private/var/containers/Bundle/Application/667D94E3-3FAA-4E27-8C69-CDB18A2052F4/WiseIDC.app/FBLPromises.framework/FBLPromises' (no such file), '/private/var/containers/Bundle/Application/667D94E3-3FAA-4E27-8C69-CDB18A2052F4/WiseIDC.app/Frameworks/FBLPromises.framework/FBLPromises' (no such file)
模拟器:
UniCore#layout#buildId:d5b5de5581d2546064e550eb3e804dd3802d5168
feature not found: uni-getSystemInfo
[ERROR] : CSS_VAR_STATUS_BAR_HEIGHT init fail
Presenting view controller <DCloudUniappRuntime.UniAppRootViewController: 0x10345b730> from detached view controller <ViewController: 0x105828400> is not supported, and may result in incorrect safe area insets and a corrupt root presentation. Make sure <ViewController: 0x105828400> is in the view controller hierarchy before presenting from it. Will become a hard exception in a future release.
[LOG] : App Launch at App.uvue:9
feature not found: uni-getSystemInfo
feature not found: UTS-Storage
[ERROR] :
[LOG] : App Show at App.uvue:14
feature not found: uni-theme
feature not found: uni-getAppBaseInfo
[ERROR] :
Detected the current OS's ImageIO PNG Decoder is buggy on indexed color PNG. Perform workaround solution...
feature not found: uni-getAppBaseInfo
[ERROR] :
feature not found: UTS-Storage
[ERROR] :
feature not found: UTS-Storage
[ERROR] :
<uni-app>[warn]UniImageComponent.swift:440, image src is empty
我一步一步都是按照文档来的,实在搞不清楚是哪里出问题了。尝试在ui-im群里咨询了,ai回复的,也没有什么按照提供的方式排查也都是正常的,但就还是会有问题。
后面我是用的SDK中的DCloudUTSExtAPI.xcframework,项目正常运行、也可以打包了,但是包大小比我依赖自己集成的DCloudUTSExtAPI.xcframework要大一些。
官方后续SDK中最好能有DCloudUTSExtAPI.xcframework的示例工程,才好方便对比差异,或者直接在示例工程上进行裁剪或者增加。









