I've created flutter app and now want to create archive for distribution in Xcode 14.3.
Issue
PhaseScriptExecution failed with a nonzero exit code
Already tried
NOTE Head over to Keychain Access.Select Lock & unlock again from the login option is disabled. How to enable it?
Looking forward for your help.
SCREENSHOT
Podfile
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
You should search this file in your project:
Pods-[your-project-name]-frameworks.sh (...-frameworks.sh)
and edit this section:
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
to:
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi
source="$(readlink "${source}")" -----> source="$(readlink -f "${source}")"
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}")"
This link maybe help you:
https://github.com/CocoaPods/CocoaPods/issues/11808
Followed @Maziar Saadatfar's instructions as stated in step 1 below and after this, one more thing that I have to do as stated in step 2.
Pods-[your-project-name]-frameworks.sh (...-frameworks.sh)
and edit this section:
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
to:
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi
source="$(readlink "${source}")"
-----> source="$(readlink -f "${source}")"
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 love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With