i am maintaining a capacitor ionic project supporting both iOS and android platform. I can build the project locally and run it on a device without any issue. But when archiving the following error pops up:
PhaseScriptExecution [CP] Embed Pods Frameworks
/Users/fabus/Library/Developer/Xcode/DerivedData/App-
gkhellzebxgrxeeuozvkjsnejnul/Build/Intermediates.noindex/ArchiveInter
mediates/App/IntermediateBuildFilesPath/App.build/Release-
iphoneos/App.build/Script-9592DBEFFC6D2A0C8D5DEB22.sh (in target
'App' from project 'App') cd
/Users/fabus/Development/showmaker/showmaker_festivals/ios/App
/bin/sh -c /Users/fabus/Library/Developer/Xcode/DerivedData/App-
gkhellzebxgrxeeuozvkjsnejnul/Build/Intermediates.noindex/ArchiveInter
mediates/App/IntermediateBuildFilesPath/App.build/Release-
iphoneos/App.build/Script-9592DBEFFC6D2A0C8D5DEB22.sh
mkdir -p /Users/fabus/Library/Developer/Xcode/DerivedData/App-
gkhellzebxgrxeeuozvkjsnejnul/Build/Intermediates.noindex/ArchiveInter
mediates/App/BuildProductsPath/Release-iphoneos/App.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/Cap
acitor.framework"
"/Users/fabus/Library/Developer/Xcode/DerivedData/App-
gkhellzebxgrxeeuozvkjsnejnul/Build/Intermediates.noindex/ArchiveInter
mediates/App/InstallationBuildProductsLocation/Applications/App.app/F
rameworks" building file list ... rsync: link_stat
"/Users/fabus/Development/showmaker/showmaker_festivals/ios/App/../..
/../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Capacitor
.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/97f6331a-ba75-11ed-
a4bc-
863efbbaf80d/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(
996) [sender=2.6.9] Command PhaseScriptExecution failed with a
nonzero exit code
I am using following pods:
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
pod 'CapacitorBrowser', :path => '../../node_modules/@capacitor/browser'
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
pod 'CapacitorNetwork', :path => '../../node_modules/@capacitor/network'
pod 'CapacitorPushNotifications', :path => '../../node_modules/@capacitor/push-notifications'
pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen'
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
pod 'CordovaPluginsStatic', :path => '../capacitor-cordova-ios-plugins'
I already desintegrated/updated pods in my ios folder. Cleaned the Build folder shift-command-k. Further there’s no special chars or whitespaces in my project name and I did renew all my certificates / load them into xcode. Restarting machine does not solve it either.
What I did as well, was checking the option "For install build only" in my Build phases (Targets > App > Build phases) as suggested here
I haven’t touched my build files (capacitor.config, package.json, …) lately
Update:
Executing the command by hand produces following ouput:
/Users/fabus/Library/Developer/Xcode/DerivedData/App-gkhellzebxgrxeeuozvkjsnejnul/Build/Intermediates.noindex/ArchiveIntermediates/App/IntermediateBuildFilesPath/App.build/Release-iphoneos/App.build/Script-9592DBEFFC6D2A0C8D5DEB22.sh: line 2: /Target Support Files/Pods-App/Pods-App-frameworks.sh: No such file or directory
3
Answers
It seems like there is an issue on Xcode 14.3 and higher. There are open issues on iOS developer forum.
ref: https://developer.apple.com/forums/thread/725230?answerId=746897022#746897022
An idea could be to downgrade to 14.2 and see if it works.
Another workaround without downgrading:
Open project in Xcode. Go to Pods -> Target Support Files -> Pods-App-Frameworks and change line 44 to below (basically adding -f in existing code):
source="$(readlink -f "${source}")"
Update cocoapods to 1.12.1 which has the fix.
gem update cocoapods
, orbundle update cocopods
if using bundle.Find the file Pods-App-Fremeworks.sh and change the code:
for this: (add the -f options after r
It’s worked for me. I hope to help you.