Failed to build iOS app
Error (Xcode): Building for 'iOS-simulator', but linking in dylib (/Volumes/huc/fair/1207/Fair/fair/ios/FairDynamicFlutter/Products/FairDynamicFlutter.framework/FairDynamicFlutter) built for 'iOS'
Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)
Could not build the application for the simulator.
Error launching application on iPhone 15 Pro Max.
报错问题:简述为:
Building for 'iOS-simulator', but linking xx.framework built for 'iOS'
解决方法如下:
修改podfile:
添加EXCLUDED_ARCHS
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |configuration|
#添加下面配置:
configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
end
end
end
然后重新执行pod install
cd ios
pod install
重新启动项目:
修改pod库的 podspec:
配置:EXCLUDED_ARCHS
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }