23
12

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.

Xcode 14.3 Archiveでビルド失敗する Command PhaseScriptExecution failed with a nonzero exit code

Posted at

Xcodeを14.3にアップデートしてからArchiveでビルド失敗

普通にシュミレーターではビルドできても、なぜかArchiveするときのビルドが失敗しました。。。

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/gen/Library/Developer/Xcode/DerivedData/Runner-aoyvbssntyfxuhfezgwaajbjclyj/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-4AFD176ECFE3FEE34085CB5D.sh (in target 'Runner' from project 'Runner')
    cd /Users/gen/Desktop/basic/flutter/lovemageddon/ios
    /bin/sh -c /Users/gen/Library/Developer/Xcode/DerivedData/Runner-aoyvbssntyfxuhfezgwaajbjclyj/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-4AFD176ECFE3FEE34085CB5D.sh

mkdir -p /Users/gen/Library/Developer/Xcode/DerivedData/Runner-aoyvbssntyfxuhfezgwaajbjclyj/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/Runner.app/Frameworks
Symlinked...
rsync --delete -av --filter P .*.?????? --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/flutter_native_splash.framework" "/Users/gen/Library/Developer/Xcode/DerivedData/Runner-aoyvbssntyfxuhfezgwaajbjclyj/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks"
building file list ... rsync: link_stat "/Users/gen/Desktop/basic/flutter/lovemageddon/ios/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/flutter_native_splash.framework" failed: No such file or directory (2)
done

sent 29 bytes  received 20 bytes  98.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/aaefcfd1-5c95-11ed-8734-2e32217d8374/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code

全くわからず調べ続けていたところ、どうやらCocoaPodsの問題?っぽことが発覚:unamused:

環境

flutter --version                                                                  (git)-[master]
Flutter 3.3.9 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b8f7f1f986 (5 months ago) • 2022-11-23 06:43:51 +0900
Engine • revision 8f2221fbef
Tools • Dart 2.18.5 • DevTools 2.15.0

Pods-Runner-frameworksを編集

Screenshot 2023-04-30 at 23.51.04.png
Flutter Project>ios>Runner.xcworkspaceからXcodeを開く

左の検索バーでsource="$(readlink "${source}")"を入れて検索し、readlinkの後ろに-fを追加

source="$(readlink "${source}")" // before

source="$(readlink -f "${source}")" // after

参考

回避策は、生成されたすべての ...-frameworks.sh ファイルを更新して、readlink の呼び出しに -f フラグを追加することです。 つまり、以下を置き換える必要があります。
source="$(readlink "${source}")"

source="$(readlink -f "${source}")"
これはCocoaPodsの問題のようです...

23
12
3

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
23
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?