LoginSignup
1
2

More than 3 years have passed since last update.

M1 マックのXcode12でシミュレータでRunした時にbut linking in object file built for iOS, ... file for architecture arm64エラーの解決方法

Posted at

環境

  • M1チップのMacBook air
  • xcode12.3
  • プロジェクトないで自作frameworkを利用している

症状

Xcode12でシミュレータでRunしようとすると、

in /Users/hoge/develop/fuga/Pods/Crashlytics/iOS/Crashlytics.framework/Crashlytics(CLSInternalReport.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/tilda/develop/fuga/Pods/Crashlytics/iOS/Crashlytics.framework/Crashlytics' for architecture arm64

のようなエラーがでて実行できない。
なお、実機では実行できる。

解決策としては
Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

[iOS] Xcode12.0で「building for iOS Simulator, but linking in object file ... for architecture arm64」エラーの対処法
がヒットするが、それをしても自作frameworkでエラーが発生する。

解決策

  1. 自作frameworkをrosettaを利用したXcodeでビルドする ←これ重要
  2. Build Settingsに以下を追記する ←これは上記で紹介した解決策の通り スクリーンショット 2021-02-26 19.27.41.png

後書き

おそらくarm版のXcodeで自作frameworkをbuildすると今度はx86_64アーキテクチャに必要なものが足りなくなっていたみたい。

しばらくはXcodeはrosettaで使った方がよさげ・・・

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2