Apple 有不同的证书类型,现在当我构建项目时,fastlane 默认选择
iOS distribution
证书。显示错误:
error: No signing certificate "iOS Distribution" found: No "iOS Distribution" signing certificate matching team ID "***" with a private key was found. (in target 'Runner' from project 'Runner')
我检查了我的本地机器证书,发现该证书是最新的
Apple Distribution
证书。
iOS distribution
?Apple Distribution
吗?这是我的本地机器证书(现在我重复使用该证书来签名应用程序):
这是我的快速通道比赛配置:
default_platform(:ios)
platform :ios do
desc "Description of what the lane does"
lane :beta do
xcode_select "/Applications/Xcode_12.4.app"
create_keychain(
name: ENV['MATCH_KEYCHAIN_NAME'],
password: ENV["MATCH_KEYCHAIN_PASSWORD"],
default_keychain: true,
unlock: true,
timeout: 3600,
lock_when_sleeps: false
)
match(
app_identifier: ENV["APP_IDENTIFIER"],
git_url: ENV["GIT_URL"],
type: "adhoc",
readonly: is_ci,
keychain_name: ENV['MATCH_KEYCHAIN_NAME'],
keychain_password: ENV["MATCH_KEYCHAIN_PASSWORD"]
)
build_app(
workspace: "Runner.xcworkspace",
scheme: "Runner",
export_method: "ad-hoc"
)
pgyer(
api_key: ENV['PGY_API_KEY'],
user_key: ENV['PGY_USER_KEY']
)
# add actions here: https://docs.fastlane.tools/actions
end
end
这应该可以解决问题:
build_app(
scheme:"prod",
export_method:"app-store",
skip_profile_detection:true,
configuration: "Release-prod",
workspace: "Runner.xcworkspace",
export_options: {
provisioningProfiles: {
APP_ID => PROVISIONING_PROFILE_APPSTORE,
WIDGET_APP_ID => WIDGET_PROVISIONING_PROFILE
},
installerSigningCertificate: "Apple Distribution: company name (id)"
}
)
快车道比赛有一个选项
generate_apple_certs
。默认值为 true
,它将生成“Apple 分发证书”。将其设置为 false
将生成“iOS 分发证书”。