Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 14.3 Bug in Build Script [CP] Embed Pods Frameworks

I've come across a bug that seems to have been introduced with Xcode 14.3, although it may have been caused by something else.

In my Build Phases, I have a phase called "[CP] Embed Pods Frameworks". That invokes a script called Pods-myapp-frameworks.sh That script fails when one of the frameworks is in a symbolically-linked folder.

Error message in the build log

The highlighted text in the build log shows the problem. It's resolved the symbolic link with a path relative to the symbolic link, and an absolute path is needed.

The path is resolved in the following code in the script (lines 42 - 45 in my copy of the script):

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

The readlink is defaulting to a relative path. Adding -f makes its output an absolute path, and all is well:

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

However, this script looks like it's been generated. I can edit it and it isn't overwritten when I rebuild, but I suspect next time I add a Pod or similar I'll be back to where I was.

So: where does this script come from? If it's generated, how do I get it to generate the correct readlink code? And is this a bug in Xcode or something that I've somehow created myself?

like image 686
Kiwi Avatar asked Oct 15 '25 08:10

Kiwi


2 Answers

Update to CocoaPods 1.12.1 to get the fix. More details at https://github.com/CocoaPods/CocoaPods/pull/11828

like image 91
Paul Beusterien Avatar answered Oct 17 '25 23:10

Paul Beusterien


I have solved with updating cocoapods to the last version by runnning sudo gem install cocoapods.

like image 21
jackcoral Avatar answered Oct 17 '25 21:10

jackcoral



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!