iosflutterxcodepodfile

Flutter iOS - Command PhaseScriptExecution failed with a nonzero exit code - ARCHIVE APP FROM XCODE


When I want to press Archive button from the Xcode, it gives UNRELAVANT this error:

Command PhaseScriptExecution failed with a nonzero exit code

How can I solve this problem? I tried:

flutter clean
flutter pub get
flutter pub cache repair
delete podfile.lock
pod install
pod update
pod repo update
pod reintegrate

and so on. Also I checked that the app can run successfully for both emulator and REAL device. I can not archive it, I need your help dear community.

Thanks

Full Error:

building file list ... rsync: link_stat "/Users/sahinefe/Documents/Github/kafile-app/ios/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/device_info_plus.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/aaefcfd1-5c95-11ed-8734-2e32217d8374/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code

Solution

  • This is an issue with XCode 14.3 and you will need to update cocoapods to fix it:

    sudo gem install cocoapods

    In case this doesn't work, go to /ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh and replace

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

    with

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

    Edit and reminder: You need to do this renaming procedure before every archive execution in case updating cocoapods doesn't work