XCode Error PhaseScriptExecution failed with a nonzero exit code
需要你的帮助。我已经创建了flutter应用程序,现在想在Xcode 14.3
中创建用于分发的存档。Issue
- 归档功能被禁用。
- 得到这个错误,构建失败
PhaseScriptExecution failed with a nonzero exit code
。
已经试过了
- Pod Install
- 清理构建文件夹
- 在你的终端应用中打开Xcode项目文件夹。 输入并执行以下命令:pod deintegrate 执行此命令:pod install 重新打开Xcode > 转到Product > Clean Build Folder.再次运行你的应用。
注意前往Keychain Access.Select Lock & unlock again from the login option is disabled.如何启用它?
期待着您的帮助。
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
你应该在你的项目中搜索这个文件:
Pods-[your-project-name]-frameworks.sh (...-frameworks.sh)
并编辑这一节:
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
至
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi
source="$(readlink "${source}")" -----> source="$(readlink -f "${source}")"
解决办法是更新所有生成的...-frameworks.sh文件,在调用readlink时加入-f标志。换句话说,将source="$(readlink "${source}")"替换为source="$(readlink -f "${source}")";
这个链接也许对你有帮助:https://github.com/CocoaPods/CocoaPods/issues/11808
如同以下人士所建议的那样
@Maziar Saadatfar
按照他在下面第1步中的指示,在这之后,还有一件事是我必须做的,如第2步中所述。
- 你应该在你的项目中搜索到这个文件:
Pods-[your-project-name]-frameworks.sh (...-frameworks.sh)
并编辑这一节:
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
至
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi
source="$(readlink "${source}")" -----> source="$(readlink -f "${source}")"
解决办法是更新所有生成的...-frameworks.sh文件,在调用readlink时加入-f标志。换句话说,将source="$(readlink "${source}")"替换为source="$(readlink -f "${source}")";