Stuck for a week and yet can’t find a solution I did everything but I can’t archive the is to submit it to AppStore. It runs on Simulator smoothly with no issues but when I click archive the below error return
PhaseScriptExecution Run Script /Users/auser/Library/Developer/Xcode/DerivedData/Runner-evxpqziwqhmcfdeqitqdevhmsglz/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-9740EEB61CF901F6004384FC.sh (in target 'Runner' from project 'Runner')
cd /Users/auser/Documents/Mobile Apps/Flutter/flutterproj/ios
export ACTION=install
export AD_HOC_CODE_SIGNING_ALLOWED=NO
export ALLOW_TARGET_PLATFORM_SPECIALIZATION=NO
export ALTERNATE_GROUP=staff
export ALTERNATE_MODE=u+w,go-w,a+rX
export ALTERNATE_OWNER=username
export ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=YES
export ALWAYS_SEARCH_USER_PATHS=NO
export ALWAYS_USE_SEPARATE_HEADERMAPS=NO
export APPLE_INTERNAL_DEVELOPER_DIR=/AppleInternal/Developer
export APPLE_INTERNAL_DIR=/AppleInternal
export APPLE_INTERNAL_DOCUMENTATION_DIR=/AppleInternal/Documentation
export APPLE_INTERNAL_LIBRARY_DIR=/AppleInternal/Library
export APPLE_INTERNAL_TOOLS=/AppleInternal/Developer/Tools
export APPLICATION_EXTENSION_API_ONLY=NO
export APPLY_RULES_IN_COPY_FILES=NO
export APPLY_RULES_IN_COPY_HEADERS=NO
export ARCHS_STANDARD=arm64
export ARCHS_STANDARD_32_64_BIT=armv7 arm64
export ARCHS_STANDARD_32_BIT=armv7
export ARCHS_STANDARD_64_BIT=arm64
export ARCHS_STANDARD_INCLUDING_64_BIT=arm64
export ARCHS_UNIVERSAL_IPHONE_OS=armv7 arm64
export ASSETCATALOG_COMPILER_APPICON_NAME=AppIcon
export ASSETCATALOG_COMPILER_FLATTENED_APP_ICON_PATH=/Users/auser/Library/Developer/Xcode/DerivedData/Runner-evxpqziwqhmcfdeqitqdevhmsglz/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/ProductIcon.png
export ASSET_PACK_FOLDER_PATH=/Users/auser/Library/Developer/Xcode/DerivedData/Runner-evxpqziwqhmcfdeqitqdevhmsglz/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/OnDemandResources
export variant=normal
/bin/sh -c /Users/auser/Library/Developer/Xcode/DerivedData/Runner-evxpqziwqhmcfdeqitqdevhmsglz/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-9740EEB61CF901F6004384FC.sh
Failed to package /Users/auser/Documents/Mobile Apps/Flutter/flutterproj.
Command PhaseScriptExecution failed with a nonzero exit code
My Podfile code:
# Uncomment this line to define a global platform for your project
platform :ios, '11.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
The flutter pubspec.yaml
name: application_name
description: Application Description
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ">=2.18.2 <3.0.0"
dependencies:
cupertino_icons: ^1.0.2
firebase_core: ^2.4.1
firebase_messaging: ^14.2.1
flutter:
sdk: flutter
flutter_launcher_icons: ^0.11.0
flutter_local_notifications: ^13.0.0
flutter_native_splash: ^2.2.16
flutter_offline: ^2.1.0
internet_connection_checker: ^1.0.0+1
url_launcher: ^6.1.7
webview_flutter: ^3.0.4
dev_dependencies:
flutter_lints: ^2.0.0
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
flutter_icons:
image_path_android: "assets/playstore.png"
image_path_ios: "assets/appstore.png"
android: true
ios: true
remove_alpha_ios: true
adaptive_icon_background: "#fff"
flutter_native_splash:
#image: ""
image: assets/splash_screen.jpg
background_image: assets/splash_screen.jpg
#color: ""
android: true
ios: true
ios_content_mode: scaleToFill
android_12:
image: assets/splash_screen.jpg
icon_background_color: "#BD081B"
I m using Xcode 14.2, MacOS Ventura 13.2, pod 1.11.3, ruby 3.0.2p107
2
Answers
I faced a similar issue before the solution was to downgrade (or install an older version of xcode) back then the issue was resolved by installing Xcode 13.2, I believe now MacOS prevents any old versions (older than 14). the issue might not be from your code, it might be from a package not compatible with the xcode building process.
what worked for me was to use ccleaner to wipe out every piece of junk in my mac. it worked just fine after that