Codemagic:为 iOS 构建时出错“未找到 'com.example.example' 的配置文件:Xcode 找不到任何 iOS 应用程序开发

Codemagic: Error when building for iOS "No profiles for 'com.example.example' were found: Xcode could't find any iOS App Development

我尝试使用 Codemagic 为 iOS 构建我的应用程序。我遵循了 Codemagic 文档中 signing iOS apps 的步骤。

No profiles for 'com.example.example' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.example.example'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.

完整错误信息:


Archiving fun.gatch.chat.example...
Automatically signing iOS for device deployment using specified development team in Xcode project: JB7VLPB7F6
Running pod install...                                             85.5s
Running Xcode build...                                          
Xcode archive done.                                          9.5s
Failed to build iOS app
Error output from Xcode build:
↳
    ** ARCHIVE FAILED **


Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/m7/h1mg7c7x40ddjz6mxjxm3htr0000gn/T/flutter_tools.TDA8uV/flutter_ios_build_temp_dirVLpaDD/temporary_xcresult_bundle

    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order
    error: No profiles for 'fun.gatch.chat.example' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'fun.gatch.chat.example'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'Runner' from project 'Runner')

    Result bundle written to path:
        /var/folders/m7/h1mg7c7x40ddjz6mxjxm3htr0000gn/T/flutter_tools.TDA8uV/flutter_ios_build_temp_dirVLpaDD/temporary_xcresult_bundle


Error (Xcode): No profiles for 'fun.gatch.chat.example' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'fun.gatch.chat.example'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.


It appears that there was a problem signing your application prior to installation on the device.

Verify that the Bundle Identifier in your project is your signing id in Xcode
  open ios/Runner.xcworkspace

Also try selecting 'Product > Build' to fix the problem:
Encountered error while archiving for device.

我的问题是 APP_STORE_CONNECT_KEY_IDENTIFIERCERTIFICATE_PRIVATE_KEY 的值是错误的。

这有点棘手,因为在我设置钥匙串的步骤中打印了此消息。错误消息为您提供签名失败的具体原因,例如:

  • GET https://api.appstoreconnect.apple.com/v1/bundleIds?limit=100&sort=name&filter%5Bidentifier%5D=bundle.id&filter%5Bplatform%5D=IOS returned 401: Authentication credentials are missing or invalid. - Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens
  • app-store-connect: error: argument --certificate-key: Provided value
  • app-store-connect: error: argument --private-key: Provided value is not a valid PEM encoded private key