0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【React Native】Apple製チップ搭載MacでiOSビルド中にCompileCエラーが出た

Last updated at Posted at 2025-05-28

やりたいこと

Apple Silicon (M1/M2/M3)で発生した、iOSシミュレーターのarm64サポートによるビルドエラーを解消したい。
確認したところ、CompileC エラーが出た場合Apple Silicon特有の問題やアーキテクチャの不一致が原因であることが多いとのこと。

解決法

ios/Podfile の post_install に以下を追記

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

その後

cd ios
pod install

【更新】直らなかった。。

↑のやり方で結果なおりませんでした。そのため取消線させていただきました。
すみません。。。。
(一応コードだけ残しておきます。)

ほんとう理由は、
RosettaがONになっていることでした。

Rosettaとは?
Intel Mac向けのアプリを、Apple Silicon(M1・M2・M3など)Macで動かせるようにするための仕組み。
世の中には Intel Mac向けに作られたアプリやツールがたくさんあるため、それらを Apple Silicon Macでも使えるようにするための機能。

参考:https://support.apple.com/ja-jp/102527

Apple Silicon (M1/M2/M3)でアプリビルドしようとしているのに、
Intel Macの環境になっている?ことが原因だったぽい。

Finderから
アプリケーション > ユーティリティ > ターミナル > 右クリックして情報を見る > Rosettaを使用して開くのチェックOFF
にして再ビルドしたら成功しました。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?