Ionic Cordova iOS xxx不支持预配置文件Azure Pipelines

时间:2020-07-01 12:36:06

标签: ios xcode cordova ionic-framework azure-pipelines

我正在使用Azure管道中的cordova构建Ionic应用程序。对于我的简单应用程序,一切正常,但是当我尝试在具有其他cordova依赖项的应用程序上运行它时,在Xcode存档步骤中遇到了以下错误。我已经添加了所有当前的故障排除步骤,并且在这一点上很困惑。

❌  error: FirebaseCore does not support provisioning profiles. FirebaseCore does not support provisioning profiles, but provisioning profile MyAppName Development has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'FirebaseCore' from project 'Pods')



❌  error: Pods-MyAppName TV does not support provisioning profiles. Pods-MyAppName TV does not support provisioning profiles, but provisioning profile MyAppName Development has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'Pods-MyAppName TV' from project 'Pods')



❌  error: leveldb-library does not support provisioning profiles. leveldb-library does not support provisioning profiles, but provisioning profile MyAppName Development has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'leveldb-library' from project 'Pods')



❌  error: GoogleUtilities does not support provisioning profiles. GoogleUtilities does not support provisioning profiles, but provisioning profile MyAppName Development has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'GoogleUtilities' from project 'Pods')



❌  error: AppAuth does not support provisioning profiles. AppAuth does not support provisioning profiles, but provisioning profile MyAppName Development has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'AppAuth' from project 'Pods')



❌  error: FirebaseInstanceID does not support provisioning profiles. FirebaseInstanceID does not support provisioning profiles, but provisioning profile MyAppName Development has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'FirebaseInstanceID' from project 'Pods')



❌  error: BoringSSL-GRPC does not support provisioning profiles. BoringSSL-GRPC does not support provisioning profiles, but provisioning profile MyAppName Development has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'BoringSSL-GRPC' from project 'Pods')



❌  error: FirebaseInstallations does not support provisioning profiles. FirebaseInstallations does not support provisioning profiles, but provisioning profile MyAppName Development has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'FirebaseInstallations' from project 'Pods')

我尝试过的一些事情是:

  • 降低Xcode版本(当前为11.3.1
  • 添加“ -UseModernBuildSystem = 0”构建标记ionic cordova build ios --buildFlag='-UseModernBuildSystem=0' $(buildEnvParam) --release
  • 更改当前macOS-10.14上的MacOS版本
  • 正在升级"cordova-ios": "^5.1.0"上的iOS平台
  • 在之后的平台添加脚本中手动修改PodFile(即使它说不这样做),以包括以下建议:https://github.com/Microsoft/azure-pipelines-tasks/issues/9984#issuecomment-483968562
  • 将代码签名设置为“自动”会通过此操作,但不会返回teamId错误

这是失败的完整归档步骤:

  task: Xcode@5
  displayName: 'Xcode archive'
  inputs:
    actions: archive
    xcWorkspacePath: 'platforms/ios/**/*.xcworkspace'
    scheme: $(buildName)
    packageApp: true
    signingOption: manual
    signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
    provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'

其他可能重要的版本:

  • ionic@5.4.16
  • cordova@9.0.0

Cordova插件:

"plugins": {
            "cordova-plugin-network-information": {},
            "cordova-plugin-whitelist": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-ionic-keyboard": {},
            "cordova-plugin-background-fetch": {},
            "cordova-plugin-camera": {},
            "cordova-plugin-filechooser": {},
            "cordova-plugin-filepath": {},
            "cordova-plugin-screen-orientation": {},
            "cordova-support-google-services": {},
            "cordova-plugin-androidx-adapter": {},
            "cordova-plugin-ionic-webview": {},
            "sentry-cordova": {
                "SENTRY_ANDROID_SDK_VERSION": "1+"
            },
            "cordova-plugin-inappbrowser": {},
            "cordova-plugin-headercolor": {},
            "cordova-plugin-firebasex": {
                "FIREBASE_ANALYTICS_COLLECTION_ENABLED": "true",
                "FIREBASE_PERFORMANCE_COLLECTION_ENABLED": "true",
                "FIREBASE_CRASHLYTICS_COLLECTION_ENABLED": "true",
                "ANDROID_ICON_ACCENT": "#FF00FFFF",
                "ANDROID_PLAY_SERVICES_AUTH_VERSION": "17.0.0",
                "ANDROID_FIREBASE_ANALYTICS_VERSION": "17.2.1",
                "ANDROID_FIREBASE_MESSAGING_VERSION": "20.0.0",
                "ANDROID_FIREBASE_CONFIG_VERSION": "19.0.3",
                "ANDROID_FIREBASE_PERF_VERSION": "19.0.1",
                "ANDROID_FIREBASE_AUTH_VERSION": "19.1.0",
                "ANDROID_FIREBASE_FIRESTORE_VERSION": "21.4.0",
                "ANDROID_CRASHLYTICS_VERSION": "2.10.1",
                "ANDROID_CRASHLYTICS_NDK_VERSION": "2.1.1",
                "ANDROID_GSON_VERSION": "2.8.6"
            }
        }
    ```

2 个答案:

答案 0 :(得分:2)

因此,在经过一段时间的测试和重构我们的代码后,解决方案是多种因素的组合,我将尝试内聚地共享。

Azure管道

此问题的第一个解决方法是修改Azure管道步骤以定义plist导出选项。不管我们尝试了什么,Automatic的默认值都将失效。为此,我们需要配置其他一些变量。这是我们使用此配置的地方:

- task: Xcode@5
  displayName: 'Xcode archive'
  inputs:
    actions: archive
    xcWorkspacePath: 'platforms/ios/**/*.xcworkspace'
    archivePath: '$(buildName).xcarchive'
    scheme: $(buildName)
    packageApp: true
    destinationTypeOption: devices
    exportOptions: plist
    exportOptionsPlist: '$(system.defaultworkingdirectory)/platforms/ios/exportOptions.plist'    
    exportPath: '$(system.defaultworkingdirectory)/platforms/ios/output/iphoneos/Release'
    signingOption: manual
    signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
    provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
    args: '$(iosCompileArgs)'

我们的iosCompileArgs传入CODE_SIGNING_ALLOWED=No,这是前面的答案中所要求的,但是并不能完全解决问题。

离子

接下来,我们需要稍微修改一下Ionic版本。我们更改的一项内容是在仓库中添加一个build.json文件。我们在开发团队分配不当方面遇到了问题。

我们的build.json看起来像这样:

{
    "ios": {
        "debug": {
            "codeSignIdentity": "iPhone Developer",
            "developmentTeam": "XXXXXXXX",
            "provisioningProfile": "XXXX-XXXX-XXXX-XXXX",
            "packageType": "development",
            "buildFlag": ["-allowProvisioningUpdates"]
        },
        "release": {
            "codeSignIdentity": "iPhone Distribution",
            "developmentTeam": "XXXXXXXX",
            "provisioningProfile": "XXXX-XXXX-XXXX-XXXX",
            "packageType": "app-store",
            "buildFlag": ["-allowProvisioningUpdates"]
        }
    }
}

最后,我们有一个particular cranky package cordova-plugin-firebasex需要固定到特定的版本"cordova-plugin-firebasex": "9.1.1-cli"

在归档之前的一个步骤中,我们运行的用于构建离子平台的命令为:

ionic cordova build ios $(buildEnvParam)

buildEnvParam为--release --device --buildConfig=build.json

结论

在这段经历中,我们遇到了无数问题。我们将打开一扇门,然后砸向另一扇。对不起,没有一个直接的答案,但是老实说,我们没有直接的问题。我希望这份摘要能帮助将来克服障碍的人。

答案 1 :(得分:1)

您可以尝试在//You can make this code as function and call it where it is require $current_user = wp_get_current_user(); if ( 0 == $current_user->ID ) return; // GET USER ORDERS (COMPLETED + PROCESSING) $customer_orders = get_posts( array( 'numberposts' => -1, 'meta_key' => '_customer_user', 'meta_value' => $current_user->ID, 'post_type' => wc_get_order_types(), 'post_status' => array_keys( wc_get_is_paid_statuses() ), ) ); // LOOP THROUGH ORDERS AND GET PRODUCT IDS if ( ! $customer_orders ) return; $product_ids = array(); foreach ( $customer_orders as $customer_order ) { $order = wc_get_order( $customer_order->ID ); $items = $order->get_items(); foreach ( $items as $item ) { $product_id = $item->get_product_id(); $product_ids[] = $product_id; } } $product_ids = array_unique( $product_ids ); if (in_array("11344", $product_ids)) { wp_redirect("https://siteurl.com/"); // Add redirect URL Here exit; } 参数中指定并检查结果吗?

如果您使用的是经典的可视化编辑器,则可以找到参数高级选项 任务。

选择CODE_SIGNING_ALLOWED=No**Export options**specify

对我有用:)

Related thread