1
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?

More than 1 year has passed since last update.

悪名高き「Command PhaseScriptExecution failed with a nonzero exit code」に対する最終手段

Last updated at Posted at 2023-06-17

「Command PhaseScriptExecution failed with a nonzero exit code」

このエラーに遭遇したら

「Command + Shift + K」「DerivedData」「Mac再起動」の他に

Xcode の Project > Build settings を開き、Excluded Architectures を検索し、
Debug、Release のそれぞれに Any iOS Simulator SDK を追加し、
値には arm64 を指定。

その後、Podfile に下記を追加。

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

等を記事通りに試されると思います。
それでも、このエラーを解決できない場合の最終手段を以下に記述します。

【最終手段】

エラーが発生したプロジェクトのコードとstoryboardのコードを
NotionやEvernote等のメモ帳にコピペしておく。

(storyboardのコードは
 2本指で同時にクリック → Open As → Source Code で見れます。)

メモ帳にコピペしたコードを新しく作成したプロジェクトの方に貼り付ける。

そして、古いプロジェクトの方の名前は「プロジェクト名Old」にする。

ビルドして上手くいくかテストする。

【結論】

自分はこのやり方でビルドに成功しました!

エラーと1日単位で戦っても解決できない場合、
最終手段としてこのやり方を採用するといいと思います!

1
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
1
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?