关于 m1 Mac 上的Xcode的一系列问题

前言,打算给女儿写一个认识小动物的游戏,在模拟器上跑起来没事,但是真机上跑突然就出现各种奇怪的错误。
最后各种搜索,各种折腾,才发现是我的 architectures 设置的不对,在excluded Architecture写的不对,我在debug和release 后面也加了 arm64,
直到我修改成如图的,立刻就好了。

第一 pod 文件中加上 只支持arm64

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

第二 设置 architectures

image.png

必须这样写 不然会出很多奇怪的错误

错误1: No such module

错误2: [The linked library 'libPods-xxx.a' is missing one or more architectures required by this target: armv7.]

错误3: Command PhaseScriptExecution failed with a nonzero exit code

错误4: xxx/Pods/Target Support Files/Pods-xxx/Pods-xxx-frameworks.sh: line 121: ARCHS[@]: unbound variable

这些错误都是因为 target 的 Deployment Target 的选择 和 pod 文件的设置(步骤1)还有 Architectures设置 导致的。
并不像他们所说的由于workspace 导致的,中文技术圈,一言难尽啊,除了抄袭就不会别的。

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

推荐阅读更多精彩内容