集成Pushologies SDK遇dyld错误:库未加载启动崩溃求助
解决Pushologies SDK集成后启动崩溃(dyld: image not found)问题
你遇到的启动崩溃报错dyld: launch, loading dependent libraries + Reason: image not found,通常是动态库加载失败导致的,结合你用Xcode 14.2、需要保留use_frameworks!的需求,试试下面这些方案:
1. 修正Podfile的链接配置
保留use_frameworks!的前提下,避免静态/动态库冲突:
- 如果Pushologies SDK支持动态链接,直接用默认的
use_frameworks!;如果部分其他Pods需要静态链接,单独指定:use_frameworks! pod 'Pushologies' # 给需要静态链接的Pod加配置 pod 'YourOtherPod', :linkage => :static - 或者统一用动态链接:
use_frameworks! :linkage => :dynamic pod 'Pushologies' # 其他Pods正常声明
2. 彻底清理缓存后重建
执行以下命令清理所有Pod相关缓存,再重新安装:
pod deintegrate pod clean rm -rf ~/Library/Caches/CocoaPods rm -rf Pods rm Podfile.lock pod install
然后在Xcode里按Cmd+Shift+K清理构建文件夹,再重新编译运行。
3. 检查Xcode关键构建设置
- 进入项目
Build Settings > Linking > Runpath Search Paths,确保Debug和Release都包含@executable_path/Frameworks - 查看
Build Settings > Packaging > Mach-O Type,主应用设为Executable,Pushologies的Pod目标设为Dynamic Library - 检查
Build Phases > Embed Frameworks,确认Pushologies的.framework文件在列表里,且Code Sign on Copy已勾选
4. 解决模拟器架构不兼容
Xcode 14.2的模拟器可能存在arm64架构冲突,在Podfile末尾添加:
post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64' end end end
执行pod install后重新构建。
5. 核对SDK依赖框架
确认项目已添加Pushologies要求的系统框架,比如UserNotifications、CoreTelephony等,对照官方文档的依赖列表检查。
内容的提问来源于stack exchange,提问作者Mishka
相关产品推荐
相关产品推荐

