Using Fastlane with upload_build_to_testflight lane getting a ** ARCHIVE FAILED ** error with error Running script 'PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks we aren't able to do further process on the build as it's stuck at gym using Jenkins By configuring these three files as mentioned below it's working fine on terminal but getting these errors from Jenkins only
(1) .env.default (2) AppFile (3) Fastfile
Please refer screenshots of ARCHIVE FAILED
This is how we got error on gym in Fastfile
Here is the configuration files which i have set:
.env.default :
ISSUER_ID=“11a2de5e-3c33-47g3-f055-5t8f7d33a6d3”
KEY_FILEPATH="./AuthKey_T43C5ACB3B.p8"
FASTLANE_KEYCHAIN_PATH="/Users/jenkins/Library/Keychains/login.keychain-db"
FASTLANE_KEYCHAIN_PASSWORD= “abcdef”
FASTLANE_PASSWORD = “password”
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD= “password”
TEAM_ID=“TEAMID”
ITC_TEAM_ID=“456456”
FASTLANE_USER= test@gmail.com
FASTLANE_TEAM_NAME=Team Inc.
FASTLANE_ITC_TEAM_NAME=Team Inc.
PRODUCE_APP_IDENTIFIER=com.fastlane.app
PRODUCE_APP_NAME= TestFastlane
PRODUCE_VERSION=1.1
PRODUCE_SKU=fastlanetest
PRODUCE_PLATFORMS=ios
PRODUCE_LANGUAGE=en-US
APP_WORKSPACE=“Fastlane.xcworkspace"
APP_SCHEME=“Fastlane”
TARGET=“Fastlane”
PROVISIONING_PROFILES=“fast lane”
XCODEPROJ=“Fastlane.xcodeproj"
CERTIFICATE="Apple Distribution: Fastlane Solutions, Inc. (TEAMID)”
AppFile
Dotenv.load '../.env.default'
app_identifier ENV["PRODUCE_APP_IDENTIFIER"] # The bundle identifier of your app
Fastfile
default_platform(:ios)
platform :ios do
profile_name = nil
app_identifier = "#{ENV["PRODUCE_APP_IDENTIFIER"]}"
app_schema = "#{ENV["APP_SCHEME"]}"
app_certificate = "#{ENV["CERTIFICATE"]}"
desc "Description of what the lane does"
lane :load_asc_api_key do
api_key = app_store_connect_api_key(
key_id: "#{ENV["KEY_ID"]}",
issuer_id: "#{ENV["ISSUER_ID"]}",
key_filepath: "#{ENV["KEY_FILEPATH"]}"
# in_house: false # detecting this via ASC private key not currently supported
)
# pilot(api_key: api_key)
end
lane :create_app_on_store do
load_asc_api_key
produce(
username: CredentialsManager::AppfileConfig.try_fetch_value(:apple_id),
app_identifier: app_identifier,
enable_services: {
push_notification: "on", # Valid values: "on", "off"
associated_domains: "on",
in_app_purchase: "on"
}
)
end
lane :create_appicon do
appicon(
appicon_image_file: '1024.png',
appicon_devices: [:ipad, :iphone, :ios_marketing],
appicon_path: "Fastlane/FastlaneImage Assest/WhitelabelledApp.xcassets"
)
end
desc "Bump build number based on most recent TestFlight build number"
lane :fetch_and_increment_build_number do
#fetch read your app identifier defined in your Appfile
api_key = lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
current_version = get_version_number(
xcodeproj: "#{ENV["XCODEPROJ"]}"
#target: "#{ENV["TARGET"]}" # replace with your main target, required if you have more than one non-test target
)
latest_build_number = latest_testflight_build_number(
api_key: api_key,
version: current_version,
app_identifier: app_identifier
)
increment_build_number(
build_number: (latest_build_number + 1),
)
end
desc "Recreate the provisioning profiles so you can deploy to your device, release on fabric and push to app store"
lane :renew_certificates do
types = ["appstore"] #"development", "adhoc"
app_identifier = app_identifier
types.each do |type|
remove_provisioning_profile(app_identifier: app_identifier, type: type)
end
end
desc "Check certs and profiles"
lane :prepare_signing do |options|
app_id = app_identifier
api_key = lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
profile_name = "#{ENV["PROVISIONING_PROFILES"]}" # replace with the name of your existing profile, or define a name for the profile that fastlane will create if it’s not found
cert(
api_key: api_key,
keychain_path: ENV["KEYCHAIN_PATH"] # the path to the keychain where your certificates are stored
)
# main app profile
sigh(
api_key: api_key,
app_identifier: app_id,
provisioning_name: profile_name,
force: true # always recreate this exact profile to ensure it's valid and not expired
)
profile_name = match_type = Actions.lane_context[SharedValues::SIGH_NAME]
end
lane :build_release do |options|
app_identifier = app_identifier
output_name = "#{ENV["PRODUCE_APP_NAME"]}" # specify the name of the .ipa file to generate
export_method = "app-store" # specify the export method
compile_bitcode = true # specify whether to enable bitcode
# turn off automatic signing during build so correct code signing identity is guaranteed to be used
update_code_signing_settings(
use_automatic_signing: false,
targets: ["#{ENV["TARGET"]}"], # specify which targets to update code signing settings for
code_sign_identity: app_certificate, # replace with name of code signing identity if different
bundle_identifier: app_identifier,
build_configurations: [app_schema], # only toggle code signing settings for Release configurations
profile_name: profile_name
)
gym(
scheme: app_schema, # replace with name of your project’s scheme
output_name: output_name,
# sdk: "iphoneos",
clean: true,
configuration: app_schema,
export_options: {
method: export_method,
provisioningProfiles: {
app_identifier => profile_name
},
compileBitcode: compile_bitcode,
xcargs: "ASSETCATALOG_COMPILER_APPICON_NAME=./Fastlane/Fastlane/Image Assest/Fastlane.xcassets/AppIcon.appiconset",
codesigning_identity: app_certificate,
}
)
end
lane :upload_release do
api_key = lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
deliver(
api_key: api_key,
skip_screenshots: true,
skip_metadata: true,
skip_app_version_update: true,
force: true, # skips verification of HTML preview file (since this will be run from a CI machine)
run_precheck_before_submit: false # not supported through ASC API yet
)
end
lane :upload_build_to_testflight do
load_asc_api_key
# create_appicon
fetch_and_increment_build_number
renew_certificates
prepare_signing
build_release
upload_release
end
end
Also i tried with pod deintegrate and install the pods using arch -x86_64 pod install Can anyone help to resolve this error?
Thanks in advance