96

enter image description here

I tried to connect flutter project to my iPhone, but suddenly this error showed up after adding Google AdMob. I've already tried keychain solution(Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code), pod deintegrate, pod clean, pod install . Also I changed project configurations variously, but it didn't work.

Build target Runner
Project Runner | Configuration Debug | Destination Ryan's iPhone | SDK iOS 13.6`
Run custom shell script 'Thin Binary' 0.1 seconds`
building file list ... rsync: link_stat "/Volumes/\#341\#204\#213\#341\#205\#265\#341\#204\#207\#341\#205\#265\#341\#206\#253\#341\#204\#202\#341\#205\#241 01071958737/DEVELOPER/dont_forget/ios/../ios/Flutter/App.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/BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-54.120.1/rsync/main.c(996) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code
RyanIdea
  • 1,289
  • 2
  • 8
  • 16
  • Have you found any solution? – Rushabh Shah Oct 14 '20 at 08:43
  • I just removed Google AdMob `admob_flutter` and tried another one `firebase_admob`. Maybe it happened I set something up wrong with `admob_flutter`. I'm not sure it's the right answer cuz it's been a while. but hope it helps. – RyanIdea Oct 18 '20 at 04:49

8 Answers8

184

CocoaPods issue. Go to: /ios/Pods/Target Support Files/Pods/Pods-AppName-frameworks.sh

Replace in *-frameworks.sh files:

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

With:

source="$(readlink -f "${source}")"
user16217248
  • 3,119
  • 19
  • 19
  • 37
Mikhail S
  • 3,338
  • 3
  • 21
  • 34
  • 8
    Yup can confirm this works after updating to MacOS Ventura 13.3 and Xcode 14.3, thanks! – MalokuS Apr 01 '23 at 21:15
  • Here the issue reported on cocoapods repo and possible PR: https://github.com/CocoaPods/CocoaPods/issues/11808 – luis Apr 02 '23 at 06:20
  • 20
    Here is the exact path for **Flutter** projects: `/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh` – Chris Apr 02 '23 at 11:56
  • 2
    This issue fixes the error, however, now the version numbering is not following the version number in the Runner Identify. Is there a way to solve this, because you cannot upload new builds with the same version or build number? – Dennis Ashford Apr 02 '23 at 13:37
  • 1
    @DennisAshford you can simply update the version number in XCode. And **important note**: you have to add the `-f` for each `archive` since it gets reset. – Chris Apr 02 '23 at 17:00
  • This issue appeared after upgrading to the latest xcode, this is the solution. – Sos. Apr 03 '23 at 00:15
  • @Chris that didn't work at first, but after I updated the version number in Xcode, I rebuilt it without the `-f` tag, and then archived with the `-f` tag and that fixed the version numbering issue I was having. – Dennis Ashford Apr 03 '23 at 18:41
  • Works! Came he after solving issue with Flutter iOS build for missing libarclite_iphoneos.a, after updating PodFile got this issue. And solution with -f helped (had to updated only 2 files with -f flag) – Zalexei Apr 04 '23 at 13:32
  • Building for flutter and during the process the file is reset. During `pod install`. So make sure to keep the file open and change it while building. – luckyhandler Apr 05 '23 at 17:11
  • This solution really worked for me after several back and forths. Thanks – DevLayi Apr 14 '23 at 14:44
  • Thank you! It works! Just remember: do not call pod install after this change (the file will reset again) – Aqua Apr 29 '23 at 07:14
  • This is still a problem as of July 6, 2023 using Xcode 14.3.1. I will never not hate flutter. – ChrisH Jul 06 '23 at 20:14
  • can confirm this works, this has been eating my head over a day, thank you!! – – Natto Aug 03 '23 at 15:12
79

I tried delete derived data its not working.(But its the simplest way if some one can fix.)

Its clearly issue of cocoa-pods in Xcode 14.3 , rsync error.

Solution :-

  • Search in Pods for selected group and search for below line.

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

  • Go inside file and replace the above line with below line.

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

enter image description here

This is the file

Bilal Khan
  • 1,023
  • 7
  • 9
41

There is an issue with Cocoapods now because Xcode 14.3 is now using a relative path in its symlink for frameworks.

Either wait for release of Cocoapods version 1.12.1 or make this simple change in your Pods-APPNAME-frameworks.sh file:

full file path /Pods/Target Support Files/Pods-APPNAME/Pods-APPNAME-frameworks.sh

APPNAME is your Application name

you need to SEARCH and REPLACE:

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

with

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

Note that -f was added.

Nitin
  • 1,383
  • 10
  • 19
21

Ok y'all listen up.

This is caused by the new XCode 14.3 and Cocoapods needing an update. That update is now live so...

First update Cocoapods

sudo gem install cocoapods

Then delete the Pods folder

cd <projectdir>
rm -rf Pods

Then run pod install

pod install

Happy days.

Ryan Knell
  • 6,204
  • 2
  • 40
  • 32
7

Deleting derived data worked for me.

Vishwas Singh
  • 1,497
  • 1
  • 18
  • 16
2

Error happens because of Cocoapods. You can manually fix .sh scripts but after 'pod install' or other manipulations it could be cleared.

Solution below is temporary (soon new Cocoapods version will be released and problem should be fixed). Who wants to work with updated Cocoapods (currenly in master) - link;

Solution from Cocoapods github issues page to change in Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    shell_script_path = "Pods/Target Support Files/#{target.name}/#{target.name}-frameworks.sh"
    if File::exists?(shell_script_path)
      shell_script_input_lines = File.readlines(shell_script_path)
      shell_script_output_lines = shell_script_input_lines.map { |line| line.sub("source=\"$(readlink \"${source}\")\"", "source=\"$(readlink -f \"${source}\")\"") }
      File.open(shell_script_path, 'w') do |f|
        shell_script_output_lines.each do |line|
          f.write line
        end
      end
    end
  end
end
Zalexei
  • 93
  • 2
  • 10
2

Fix is available on latest on latest version of cocoapods (at time of writing 1.12.1). Please run below commands you should to be good to go.

sudo gem update cocoapods
pod install
SuryaKantSharma
  • 1,113
  • 12
  • 27
0

This issue happens with Xcode 14.3. Solution is just update the cocoapods to 1.12.1

you no need to do below manual podfile update

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

it will go away once you re do pod install.

Solution : https://github.com/CocoaPods/CocoaPods/releases

MuraliMohan
  • 1,063
  • 1
  • 11
  • 30