xcode 运行自定义shell脚本“[CP] Embed Pods Frameworks”

iq0todco  于 2023-04-07  发布在  Shell
关注(0)|答案(2)|浏览(668)

我在维护一个同时支持iOS和android平台的capacitor ionic项目,我可以在本地构建项目并在设备上运行,没有任何问题。但是存档时弹出以下错误:

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

我正在使用以下pod:

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'

我已经在我的ios文件夹中解集成/更新了pod。清理了Build文件夹shift-command-k。此外,我的项目名称中没有特殊字符或空格,并且我更新了所有证书/将它们加载到xcode中。重启机器也不能解决这个问题。
我所做的也是在我的构建阶段(目标〉应用〉构建阶段)中检查“For install build only”选项,如here所建议的
我最近没有碰过我的构建文件(capacitor.config,package.json,...

更新:

手动执行命令会产生以下输出:

/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
zour9fqk

zour9fqk1#

Xcode 14.3及更高版本似乎有问题。iOS开发者论坛上有开放的问题。
参考:https://developer.apple.com/forums/thread/725230?answerId=746897022#746897022
一个想法可能是降级到14.2,看看它是否有效。
另一个不降级的解决方法:在Xcode中打开项目,进入【Pods -〉Target Support Files -〉Pods-App-Frameworks】,将第44行修改为下面的内容(基本上就是在现有代码中添加-f):
source="$(readlink -f“${source}”)”

xghobddn

xghobddn2#

我读了很多变通方案,我认为目前最好的解决方案是降级到14.2,我也遇到了同样的问题,降级Xcode效果很好

相关问题