尝试使用Codemagic构建Flutter应用程序时,“ App.framework不支持配置文件”

时间:2020-01-05 14:04:49

标签: ios flutter codemagic

我正在尝试使用codemagic(因为我使用的是Windows机器)来开发和发布我的flutter应用程序以用于开发目的(使用testmagic对其进行测试)。但是每次我构建应用程序时,步骤build都会失败,并显示以下错误:

Unable to export archive: 2020-01-05 05:46:47.914 xcodebuild[1398:9643] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/Runner_2020-01-05_05-46-47.912.xcdistributionlogs'. error: exportArchive: App.framework does not support provisioning profiles. Error Domain=IDEProvisioningErrorDomain Code=10 "App.framework does not support provisioning profiles." UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription=App.framework does not support provisioning profiles., NSLocalizedRecoverySuggestion=App.framework does not support provisioning profiles, but provisioning profile {Name of the App + ID} has been manually specified. Remove this item from the "provisioningProfiles" dictionary in your Export Options property list.} ** EXPORT FAILED **

错误消息中有一部分说我应该从provisioningProfiles字典中删除该项目:

 Remove this item from the "provisioningProfiles" dictionary in your Export Options property list.

我不明白这是什么意思。我尝试从Apple开发者帐户中删除自动生成的配置文件,但这不起作用。


构建设置:

codemagic build settings

代码签名设置:

codemagic code signing settings

我不知道为什么会这样。我在互联网上发现了一些关于类似探针的github问题,但是每个问题仍然是公开的,并且不是活动的,或者不是针对xcode用户的,并且我没有使用xcode。

3 个答案:

答案 0 :(得分:1)

旧问题,但我认为此解决方案应适用于再次偶然发现此问题的人。通常,这只会影响尝试在没有Mac的情况下进行构建的用户,然后他们编辑可以找到的每个“ BundleIdentifier”实例。

解决方法是打开您的AppFrameworksInfo.plist文件,并将CFBundleIdentifier更改为io.flutter.flutter.app,而不是您的包ID。

<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>

答案 1 :(得分:0)

这不是您问题的直接答案,但我设法为Flutter AndroidIOS应用程序入门模板创建了构建管道,无需物理macOS设备。

所有带源代码的步骤均为documented here

希望这会有所帮助!

答案 2 :(得分:0)

如果您使用 CI/CD(例如 Azure DevOpps)并传递 xcodebuild 命令行构建配置参数,例如 PRODUCT_BUNDLE_IDENTIFIERPROVISIONING_PROFILE_SPECIFIER,它也会向下传递到其他 pods 项目。正如@arnold-veltmann 所说,here 罪魁祸首是将 PRODUCT_BUNDLE_IDENTIFIER 传递给不支持签名的项目 (pods)。在我的例子中,它用于一个使用 Ionic 5Capacitor 的项目,它使用了 cocoapods。

pods 文件中通常的 post_install 解决方案对我不起作用

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
      config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
      config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
      end
    end
end

尽管我确实检查过并且 post_install 运行并正确设置了构建配置。

我最终做的是创建一个自定义构建设置,例如 SP_PRODUCT_BUNDLE_IDENTIFIER 并将其传递到 azure devops yaml 管道 xcode 构建步骤

 - task: Xcode@5
    displayName: 'Build iOS app'
    inputs:
      actions: 'build'
      configuration: 'Appcenter'
      sdk: 'iphoneos'
      xcWorkspacePath: 'ios/App/App.xcworkspace'
      scheme: 'App'
      xcodeVersion: '11'
      packageApp: true
      archivePath: './output'
      exportPath: './output'
      exportOptions: 'plist'
      exportOptionsPlist: './_deploy/Appcenter-ExportOptions.plist'
      signingOption: 'default'
      args: SP_PRODUCT_BUNDLE_IDENTIFIER=$(bundleIdentifier) SP_PROVISIONING_PROFILE_SPECIFIER=$(iosProvisioningProfile)

之后在 project.pbxproj 中,我找到了用于 Appcenter (CI/CD) 构建和设置的构建配置

E6D3FFF3256E6D8500109D05 /* Appcenter */ = {
            isa = XCBuildConfiguration;
            baseConfigurationReference = A158677F50F9AF6793C0B6F1 /* Pods-App.appcenter.xcconfig */;
            buildSettings = {
                ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
                CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
                CODE_SIGN_IDENTITY = "iPhone Distribution";
                CODE_SIGN_STYLE = Manual;
                DEVELOPMENT_TEAM = B982UY6B4T;
                INFOPLIST_FILE = App/Info.plist;
                IPHONEOS_DEPLOYMENT_TARGET = 12.0;
                LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
                PRODUCT_BUNDLE_IDENTIFIER = "$(SP_PRODUCT_BUNDLE_IDENTIFIER)";
                PRODUCT_NAME = "$(TARGET_NAME)";
                PROVISIONING_PROFILE_SPECIFIER = "$(SP_PROVISIONING_PROFILE_SPECIFIER)";
                SWIFT_ACTIVE_COMPILATION_CONDITIONS = USE_PUSH;
                SWIFT_VERSION = 5.0;
                TARGETED_DEVICE_FAMILY = 1;
            };
            name = Appcenter;
        };

注意 PROVISIONING_PROFILE_SPECIFIER = "$(SP_PROVISIONING_PROFILE_SPECIFIER)";

我希望这对某人有所帮助,因为我花了 1 天时间,构建了 1000 次,但又失败了 1001 次。