32

I've upgraded from xcode 14.2 to xcode 14.3 beta, and now I can't archive anymore for Any iOS Device (arm64) with the following error :

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks

mkdir -p /Users/max/Library/Developer/Xcode/DerivedData/Max-dmwafkgdrzqavzcmbdjbjgmmuxby/Build/Intermediates.noindex/ArchiveIntermediates/Release_preprod/BuildProductsPath/Release_preprod-iphoneos/MaxApp.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/ActionSheetPicker_3_0.framework" "/Users/max/Library/Developer/Xcode/DerivedData/Max-dmwafkgdrzqavzcmbdjbjgmmuxby/Build/Intermediates.noindex/ArchiveIntermediates/Release_preprod/InstallationBuildProductsLocation/Applications/MaxApp.app/Frameworks"

building file list ... rsync: link_stat "/Users/max/Workspace/MaxApp/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/ActionSheetPicker_3_0.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/9e200cfa-7d96-11ed-886f-a23c4f261b56/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]

Command PhaseScriptExecution failed with a nonzero exit code

Any idea why it works fine with xCode 14.2 and not with xCode 14.3 beta please ?

I tryed to delete the [CP] Embed Pods Frameworks script, but it has re-created it and get the same issue. I tryed to build and debug in a simulator, and it works fine. I tryed to delete "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; in the .pbxproj file

Maxime Esprit
  • 705
  • 1
  • 8
  • 29
  • Tested again with xCode 14.3 beta 2, and still have the same issue :( Any idea please ? – Maxime Esprit Mar 01 '23 at 16:08
  • Have you found a solution yet? – holyavkin Mar 07 '23 at 03:17
  • No solution at this moment – Maxime Esprit Mar 07 '23 at 08:34
  • We used `use_frameworks!` and it led to the same errors. adding `, :modular_headers => false;` after pods that don't work in static mode helped. – holyavkin Mar 14 '23 at 05:26
  • Having the same issue, found because Xcode Cloud failed to build. So far I haven't found a solution — only this in the Xcode release notes `Xcode 14.3 includes a new module verifier that generates diagnostics for issues in a framework’s modules.`, which might be relevant... or maybe not. – Antonio Mar 22 '23 at 22:34
  • 3
    There is an active issue on the Cocoapods repo for this. See it https://github.com/CocoaPods/CocoaPods/issues/11808, and an open PR with potential fix https://github.com/CocoaPods/CocoaPods/pull/11828 – Benjamin Hall Mar 24 '23 at 09:57
  • Check this to fix this issue: https://stackoverflow.com/a/75947102/6667442 – Ketan Ramani Apr 06 '23 at 07:57

4 Answers4

78

Resolving this problem was one of the most tricky errors in my life..

I resolved this for a Flutter project, in your case it might be a native iOS project.

It's easier to do the following:

1- Open your project using XCode

2- Search of "Symlinked..."

3- Replace source="$(readlink "${source}")" with source="$(readlink -f "${source}")"

4- Try again to build your project or export your ipa it should work

enter image description here

For reference check more details here

Abdulrahman Alhayek
  • 1,626
  • 2
  • 15
  • 20
17

Update 2: On the 18th of April 2023 the new CocoaPods version 1.12.1 got finally released and it includes the fixes needed to solve the problem that this ticket is about: https://github.com/CocoaPods/CocoaPods/releases/tag/1.12.1

Note: if you edited files in your project to solve the problem, or switched to the master branch of CocoaPods, then you might want to undo those changes as they are not needed anymore due to the release of CocoaPods 1.12.1, if you keep the changes you might run into problems in the future, see my "EDIT" at the end of this ticket for more

Update 1: the pull request with a fix (mentioned in my initial answer) has been merged into the master branch of cocoapods (on april 3rd: https://github.com/CocoaPods/CocoaPods/issues/11808#issuecomment-1494709564) but it is not yet in a release, it should be part of the next release 1.12.1 (as one of the maintainers commented here: https://github.com/CocoaPods/CocoaPods/pull/11828#issuecomment-1496357883) but as of now this has not happend yet (you can keep an eye on the releases list here: https://github.com/CocoaPods/CocoaPods/releases)

if you use ruby gem to install your cocoapods and don't want to do the downgrade from Xcode 14.3 to 14.2 (as described in my initial answer) then you can switch manually to the master branch of cocoa pods using the following commands:

git clone https://github.com/CocoaPods/CocoaPods.git --branch master
cd CocoaPods
gem build cocoapods.gemspec
gem install ./cocoapods-*.gem

and finally you need to manually remove the previously installed pods as well as the pods lock file from your project, then re-build the pods folder using the command specific to your framework (for example for capacitor use: npx cap sync) or use this command:

pod install

Initial answer: I have a similar issue, it seems to be related to cocoa pods, there is a ticket about the problem here: https://github.com/CocoaPods/CocoaPods/issues/11808#issuecomment-1481244508

a pull request with a potential fix has already been submited by a github user: https://github.com/CocoaPods/CocoaPods/pull/11828

if you want to apply the fix yourself and not wait for a release, you can do what the author of the fix suggested (in his follow up comment: https://github.com/CocoaPods/CocoaPods/issues/11808#issuecomment-1480802886):

Workaround is to update all the generated ...-frameworks.sh files to add the -f flag to the call to readlink. In other words, replace:

source="$(readlink "${source}")"

with

source="$(readlink -f "${source}")"

if you scroll down one comment you will find a comment by another github user with a another temporary solution which is to downgrade to xcode build tools from 14.3 to 14.2 for builds (works for both builds in the IDE and builds in the xcode cloud):

here are the screenshots from that ticket, showing how to downgrade from 14.3 command line tools version to a 14.2 version in the Xcode IDE:

in your Xcode IDE (Xcode 14.3) go to "Settings" open the "Locations" tab and then select "Command Line Tools" and choose "Xcode 14.2 (14C18)"

Xcode IDE change command line tools version being used

and if you are using the Xcode cloud to do your builds, refer to this screenshot instead to change the Xcode version in your workflow (you can edit the workflow either in your Xcode IDE or on the appstore connect website (https://appstoreconnect.apple.com/)):

edit your "workflow" > "Environment" and then select as Xcode Version "Xcode 14.2 (14C18)" (instead of 14.3)

xcode cloud downgrade xcode version

EDIT: I recommend watching for a 1.12.1 release here: https://github.com/CocoaPods/CocoaPods/releases which will have the fix, you can also subscribe to the github ticket and PR (mentioned above), so that when the fix is released you don't manually downgrade the xcode version anymore (it is always best to use the latest version, if you keep it downgraded it will cause trouble in the future as at some point packages and tools you use for your app will not be compatible with xcode 14.2) or if you chose to use the cocoapods master branch, you might after the release want to undo that change so that you are sure to use the release version again and not the master branch (the master branch might include features that are still unstable because they are in beta compared to the release version which is deemed to be stable)

chrisweb
  • 1,428
  • 19
  • 25
  • And if you no longer have 14.2 locally, try this way to dowload 14.2 and manually switch/downgrade: https://stackoverflow.com/a/64422114/117750 – or9ob Mar 31 '23 at 20:37
  • A link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](//meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. [Answers that are little more than a link may be deleted](/help/deleted-answers). – Machavity Apr 05 '23 at 03:11
  • If you can add more than just links, feel free to flag for undeletion – Machavity Apr 05 '23 at 03:12
2

If you used Xcode or Xcode Cloud, just downgrade to 14.2.

For Xcode:

change Command line tool

For Xcode Cloud:

change the environment

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
  • Thank you! I was unable to release my app update since XCode Cloud was failing. This buys me some time until CocoaPods gets things worked out. – bgolson Mar 25 '23 at 12:56
0

If you're encountering an error while exporting a build in Xcode 14.3, there's good news - Cocoapods will be releasing a build (version 1.12.1) soon that addresses the issue.

In the meantime, you can try the following solution: navigate to the Pods/Target Support Files/Pods-ProjectName/ directory and open the Pods-ProjectName-frameworks.sh file. Then, replace line 44 with code "$(readlink "${source}")" with "$(readlink -f "${source}")".

Source: https://github.com/CocoaPods/CocoaPods/pull/11828

The cocoapods version of 1.12.1 is yet to release.

Hope it will work.

Shamim Hossain
  • 1,690
  • 12
  • 21