运行自定义外壳脚本'[CP] Embed Pods Frameworks'



我正在维护一个支持iOS和android平台的电容器离子项目。我可以在本地构建项目然后在设备上运行,没有任何问题。但是当存档时弹出以下错误:

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

我使用以下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'

我已经在我的ios文件夹中分解/更新了pods。清理了Build文件夹,shift-command-k。此外,我的项目名称中没有特殊字符或空白,我确实更新了所有证书/将它们加载到xcode中。重新启动机器也不能解决这个问题。

我所做的,是检查选项"For install build only"在我的构建阶段(目标>应用程序在构建阶段)

我还没有触及我的构建文件(电容器。配置,包。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 ->目标支持文件->Pods-App-Frameworks并将第44行更改为下面(基本上是在现有代码中添加-f):

源="$(指向- f"${来源}"),

新解决方案:将cocoapods的版本更新到最新版本,它应该会自动解析。

将cocoapods更新到1.12.1。

gem update cocoapods,如果使用bundle则为bundle update cocopods,如果使用brew则为brew upgrade cocoapods

找到文件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

这对我很有效。我希望能帮到你。

完成以下更改后:

if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi

我们需要执行以下步骤使其工作:

  1. pod会分解并整合回来吗?
  2. 清除构建文件夹&
  3. 尝试重新构建或存档。

在Xcode中输入echo "Symlinked..."

在readlink后添加-f

或将source="$(readlink "${source}")"替换为source="$(readlink -f "${source}")"

它对我来说很好。

看起来差不多。这是工作https://developer.apple.com/forums/thread/727525

Cocoapods现在有一个问题,因为Xcode 14.3现在在框架的符号链接中使用相对路径。

等待Cocoapods 1.12.1版本发布,或者在您的Pods-APPNAME-frameworks.sh文件中进行以下简单更改:

替换:

if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi

:

if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi

注意-f被添加了。

最新更新