运行自定义的shell脚本'[CP] Embed Pods Frameworks'
我正在维护一个支持iOS和Android平台的电容式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文件夹中分解/更新了pods。清理了Build文件夹shift-command-k。此外,在我的项目名称中没有特殊的字符或空格,我确实更新了所有证书/将它们加载到 xcode 中。重启机器也没有解决。
我所做的也是在我的构建阶段(Targets > App > Build phases)中检查选项"For install build only",正如这里所建议的 。
我最近没有碰过我的构建文件(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
在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}")"
xcodebuild
CLI的ipa归档中运行良好。当从命令行构建一个ionic电容应用程序时,错误显示为"cocoapods DVTCoreDeviceEnabledState"。
- Tom McLellan 2023-04-12
将cocoapods更新到1.12.1,该版本有修复功能。
gem update cocoapods
,或bundle update cocopods
(如果使用bundle),或brew upgrade cocoapods
(如果用brew安装)。
Pods
目录并重新安装(例如在新的机器上),它也会持续存在。
- thehale 2023-05-12
找到文件Pods-App-Fremeworks.sh,并修改代码:
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
为此:(在r后面添加-f选项
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi
这对我很有效。我希望能帮助你。