2
votes

I'm building an Ionic application, using cordova, in Azure pipelines. Everything is working fine for my simple application, but when I try to run it on an application that has other cordova dependencies I'm getting the errors below during the Xcode archive step. I've added all my current troubleshooting steps and am quite stumped at this point.

❌  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')

Some things I've tried are:

  • Lowering the Xcode version (currently on 11.3.1
  • Adding "-UseModernBuildSystem=0" build flag ionic cordova build ios --buildFlag='-UseModernBuildSystem=0' $(buildEnvParam) --release
  • Changing the MacOS version currently on macOS-10.14
  • Upgrading iOS Platform currently on "cordova-ios": "^5.1.0"
  • Manually modifying the PodFile (even though it says not to) in an after platform add script to include the following suggestion: https://github.com/Microsoft/azure-pipelines-tasks/issues/9984#issuecomment-483968562
  • set code signing to "Automatic" passes this, but returns no teamId error

Here is the full archive step it is failing on:

  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)'

Other Versions that may be important:

Cordova plugins:

"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
Do you use a Self-hosted agent? If you run Xcode archive locally on your machine, how 's the result? - Cece Dong - MSFT
No this is using Azure's hosted instance. I don't have access to a mac locally, but I'm trying to get that and see what the local results are. I was able to make a some progress by adding args: 'CODE_SIGNING_ALLOWED=No', but I'm worried that will be an issue when I try to publish to the App Store. - John Graham
I am actually able to recreate it locally, back to the drawing board I guess - John Graham
I did get this to work locally by passing the CODE_SIGNING_ALLOWED=No, but when I do that in azure with args: 'CODE_SIGNING_ALLOWED=No' I'm now getting an error for: error: exportArchive: No 'teamID' specified and no team ID found in the archive - John Graham
Check the reply in this case to set the Team (ID) directly in the Xcode project to see whether it helps you: stackoverflow.com/questions/55458127/…. - Cece Dong - MSFT

2 Answers

2
votes

So after a while of testing and refactoring our code the solution was a combination of factors that I will try to share cohesively.

Azure Pipelines

The first fix to this issue was to modify our Azure pipeline step to define plist export options. The default value of Automatic just wouldn't work no matter what we tried. With this we needed to configure some other variables. Here is where we landed with this configuration:

- 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)'

Our iosCompileArgs is passing in CODE_SIGNING_ALLOWED=No which was required as called out in the previous answers, but doesn't get you all the way.

Ionic

Next we needed to modify our Ionic build a bit. One of the items we changed was adding a build.json file to the repo. We were having issues with the development team not being assigned properly.

Our build.json looks like this:

{
    "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"]
        }
    }
}

Finally we had a particular cranky package cordova-plugin-firebasex that needed to be pinned to a specific version "cordova-plugin-firebasex": "9.1.1-cli".

The command we run to build the ionic platform in a step prior to archiving is:

ionic cordova build ios $(buildEnvParam)

With the buildEnvParam being --release --device --buildConfig=build.json

Conclusion

Throughout this experience we encountered countless issues. We would open one door and get smashed in the face with another. I'm sorry there isn't a straight forward answer, but honestly we didn't have a straight forward problem. I hope this summary will help someone get over a hurdle in the future.

1
votes

can you try to specify in CODE_SIGNING_ALLOWED=No arguments and check the result.

if u are using the classic visual editor u can find the arguments Advance options of the task.

choose **Export options** to specify add Team ID

it worked for me :)

Related thread