ios - Ionic Cordova iOS xxx 不支持预配配置文件 Azure Pipelines
问题描述
我正在 Azure 管道中使用 cordova 构建一个 Ionic 应用程序。我的简单应用程序一切正常,但是当我尝试在具有其他科尔多瓦依赖项的应用程序上运行它时,我在 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 版本
macOS-10.14
- 正在升级 iOS 平台
"cordova-ios": "^5.1.0"
- 在后平台添加脚本中手动修改 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
科尔多瓦插件:
"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"
}
}
```
解决方案
因此,经过一段时间的测试和重构我们的代码,解决方案是我将尝试统一分享的多种因素的组合。
Azure 管道
解决此问题的第一个方法是修改我们的 Azure 管道步骤以定义 plist 导出选项。无论我们尝试什么,默认值Automatic
just 都不起作用。有了这个,我们需要配置一些其他变量。这是我们使用此配置的地方:
- 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 文件添加到 repo。我们遇到了未正确分配开发团队的问题。
我们的 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"]
}
}
}
最后,我们有一个特别古怪的包 cordova-plugin-firebasex
,需要固定到一个特定的版本"cordova-plugin-firebasex": "9.1.1-cli"
。
在归档之前,我们运行来构建 ionic 平台的命令是:
ionic cordova build ios $(buildEnvParam)
随着 buildEnvParam 是--release --device --buildConfig=build.json
结论
在这段经历中,我们遇到了无数的问题。我们会打开一扇门,然后被另一扇门砸在脸上。很抱歉,没有直截了当的答案,但老实说,我们没有直截了当的问题。我希望这个总结能帮助某人在未来克服障碍。
推荐阅读
- javascript - TypeError this.$refs.password 在 Vue JS 中未定义
- ruby-on-rails - Stripe::Customer.create 未将付款方式附加到客户
- android - 尝试进行接口类型的成员注入时 Dagger 2 NPE
- laravel - 非 www url 正在重定向到主页
- spring - 如何获取本地到 Spring Boot 以本地化消息?
- c# - 使用 Prism 在 WPF 应用程序中使用 RESX 文件
- java - Amazon Coretto 11、Spring Boot 和 PowerMock - 测试失败
- node.js - 在节点中生成后在子进程中提供输入
- node.js - 异步 / 等待 Node.js https.get
- javascript - 如何将永久数据添加到变量中