执行Pod Install时遇Pods-Runner静态链接二进制依赖问题求助
解决Flutter Pod Install中静态链接二进制传递依赖问题
问题场景
Flutter环境为stable频道最新版本:Flutter 3.3.8,Framework版本52b3dc25f6,Engine版本857bd6b74c,配套Dart 2.18.4、DevTools 2.15.0。执行pod install时提示:'Pods-Runner' target存在包含静态链接二进制文件的传递依赖:Mux-Stats-AVPlayer/XCFramework/MUXSDKStats.xcframework
解决方案
修改Podfile配置,强制将Mux-Stats-AVPlayer设置为静态框架并调整链接参数:
在ios目录下的Podfile中,target 'Runner' do代码块内添加以下预处理脚本:pre_install do |installer| installer.pod_targets.each do |pod| if pod.name == 'Mux-Stats-AVPlayer' pod.build_configurations.each do |config| config.build_settings['OTHER_LDFLAGS'] = '-ObjC' end pod.static_framework = true end end end清理缓存后重新执行安装:
依次执行以下命令:flutter clean cd ios pod deintegrate pod cache clean --all pod install检查依赖引入方式:
若为手动引入Mux-Stats-AVPlayer框架,确认未误将静态框架以动态依赖方式引入,调整为静态链接配置;若是通过Flutter插件间接引入,确保插件的podspec配置正确,必要时在本地Podfile中覆盖其配置。
内容的提问来源于stack exchange,提问作者Federico
相关产品推荐
相关产品推荐

