Need you help please. I’ve created flutter app and now want to create archive for distribution in Xcode 14.3
.
Issue
- Archive is disabled.
- Getting this error with build failed
PhaseScriptExecution failed with a nonzero exit code
Already tried
- Pod Install
- Clean build folder
- Open the Xcode project folder in your Terminal app.
Enter and execute the following command: pod deintegrate
Execute this command: pod install
Re-open Xcode > go to Product > Clean Build Folder.
Run your app again.
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.
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
2
Answers
As suggested by
Followed his 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:
to
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}")"
you should search this file in your project:
Pods-[your-project-name]-frameworks.sh (…-frameworks.sh)
and edit this section:
to
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