模拟器和真机关于Cocopods导入三方框架的警告和编译报错

1.pod install报警告,[Debug]` target overrides the `EXCLUDED_ARCHS[sdk=iphonesimulator*]` build setting defined in

2.模拟器编译报错 error build: Command PhaseScriptExecution failed with a nonzeroexit code

3.老版本(iOS12)模拟器可以运行,新版本(iOS15)模拟器编译报错。模拟器可以运行,真机编译报错。版本兼容问题。

以上都可能是编译环境配置的问题

处理方式:

1.在podfile文件中添加如下代码: (放在target 'xxx' do 之前)

post_install do |installer|

installer.pods_project.build_configurations.each do |config|    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"

  end

end

2.podfile文件 取消版本注释,明确版本兼容        如 platform :ios, '11.0'   

3.在Targets → Build Settings → Excluded Architecture中Debug和Release后面值增加 $(inherited),删除其他(arm64,armv7等)

4.Targets → Build Settings → Excluded Architecture中Debug和Release添加 Any iOS Simulator SDK属性,添加值 $(inherited)并设置Targets → Build Settings → Active Architecture都为YES;

5.pod install,警告消失。

($(inherited )  会自动配置,如Simulator SDk配置为arm64)

6.clean一下,重新编译


7. 如果pods里面一团糟了,就删除pods 。删除如下文件


重新 pod init,vim podfile.....

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容