azure-flutter-tasks icon indicating copy to clipboard operation
azure-flutter-tasks copied to clipboard

iOS Signing on macOS13 pipeline: error: exportArchive: No Accounts - exportArchive: No profiles for <bundleID> were found

Open TobiasHanitsch opened this issue 4 months ago • 8 comments

Hi! We are building an iOS Flutter app in an Azure DevOps Pipelines. The pipeline consists of: Using the Microsoft-provided tasks to install the signing certificate and provisioning profile after uploading these files into the DevOps project. Then, we insert their UUID and Signing identity into our configs (4 flutter environment variables, such as "FLUTTER_XCODE_CODE_SIGN_IDENTITY" and the exportOptions.plist file) and finally we install Flutter and build the app into an IPA file.

This used to work well and would generate a working IPA while we were working on Microsoft's MacOS12 pipeline agents. Now we upgraded to MacOS13 and because of this single change, the build fails with the following error:

Encountered error while creating the IPA:
error: exportArchive: No Accounts
error: exportArchive: No profiles for '<bundleID>' were found

I am aware that this seems similar to other common signing issues (that I had a ton of already too) but this is decidedly different in my eyes and I am unable to fix it. The fact that it works perfectly on macOS12 but not on macOS13 is also very curious.

Since we are using official Microsoft hosted agents, we can check their pre-installed software on their "Microsoft-hosted agents" documentation page. We tried using xCode 15.2 instead of the default 15.0.1 version, but it didn't change anything.

We are using an "Enterprise" apple developer account. The same certificate and other provisioning profiles that were generated in the exact same way work for other apps.

We tried generating a completely new cert and profile carefully, but it didn't change anything either.

The installation of both the cert and profile seems to work successfully and completely.

I also contacted Apple support about this in hopes of more details.

This is our exportOptions.plist file:

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "[http://www.apple.com/DTDs/PropertyList-1.0.dtd">](http://www.apple.com/DTDs/PropertyList-1.0.dtd%22%3E)
<plist version="1.0">
<dict>
    <key>compileBitcode</key>
    <true/>
    <key>method</key>
    <string>enterprise</string>
    <key>signingStyle</key>
    <string>automatic</string>
    <key>stripSwiftSymbols</key>
    <true/>
    <key>teamID</key>
    <string>XXXXX</string>
    <key>thinning</key>
    <string>&lt;none&gt;</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>XXXX</key>
        <string>XXXX</string>
    </dict>
</dict>

This is our pipeline:

  name: Azure Pipelines
  demands: xcode

steps:
- task: InstallAppleCertificate@2
  displayName: 'Install an Apple certificate'
  inputs:
    certSecureFile: 'XXXX'
    certPwd: 'XXXX'
    setUpPartitionIdACLForPrivateKey: false

- task: InstallAppleProvisioningProfile@1
  displayName: 'Install an Apple provisioning profile'
  inputs:
    provProfileSecureFile: 'XXXX'

- bash: |
   echo "##vso[task.setvariable variable=FLUTTER_XCODE_DEVELOPMENT_TEAM]XXXX"
   echo "##vso[task.setvariable variable=FLUTTER_XCODE_CODE_SIGN_IDENTITY]XXXX"
   echo "##vso[task.setvariable variable=FLUTTER_XCODE_PROVISIONING_PROFILE]XXXX"
   echo "##vso[task.setvariable variable=FLUTTER_XCODE_CODE_SIGN_STYLE]Manual"
   
   sed -i -e 's,teamIDPlaceholder,XXXX,g' 'ios/Runner/ExportOptions/exportOptions.plist'
   sed -i -e 's,provisioningProfilesPlaceholder,XXXXX,g' 'ios/Runner/ExportOptions/exportOptions.plist'
   sed -i -e 's,appIdPlaceholder,XXXX,g' 'ios/Runner/ExportOptions/exportOptions.plist'
   cat ios/Runner/ExportOptions/exportOptions.plist
  displayName: 'Bash Script IOS APPLE'

- task: Hey24sheep.flutter.flutter-install.FlutterInstall@0
  displayName: 'Flutter Install'

- task: Hey24sheep.flutter.flutter-build.FlutterBuild@0
  displayName: 'Flutter Build ipa'
  inputs:
    target: ipa
    projectDirectory: '$(Build.SourcesDirectory)'
    entryPoint: 'lib/main_staging.dart'
    exportOptionsPlist: '$(build.sourcesDirectory)/ios/Runner/ExportOptions/ExportOptions.plist'
    dartDefineMultiArgSeparator: 'APP_ID=XXXXX SENTRY_DSN=$(sentry_dsn) SERVICE_BASE_URL=$(SERVICE_BASE_URL)'

Let me know if you require any more details.

Thank you in advance.

EDIT 21.03.2024: I also contacted Microsoft support now. No response from apple yet...

TobiasHanitsch avatar Mar 18 '24 11:03 TobiasHanitsch

Also having issues on my side, on both 12 and 13 at the moment I think, if it's really 13 related, it's bad because I think it's required to target iOS 17.

Soap-141 avatar Mar 18 '24 14:03 Soap-141

Hi @TobiasHanitsch @Soap-141 can you please go through these links. I can't help much here as I do not have access to a devops account and neither to a Mac. It could be that there might be a version mismatch on the hosted agents in XCode or MacOS. Could you verify that with your local versions where you could build the IPA.

Usually the profile not found comes when the pipeline for some reason can't find the downloaded profile. But, if you say you had those and this error is different it could be the reason

  • https://github.com/hey24sheep/azure-flutter-tasks/wiki/IOS-&-Android-Example-Setup-Guide
  • https://github.com/hey24sheep/azure-flutter-tasks/wiki/Our-IOS-Build-Solution
  • https://github.com/hey24sheep/azure-flutter-tasks/wiki/Other-IOS-Build-Issues
  • https://github.com/hey24sheep/azure-flutter-tasks/issues/49

hey24sheep avatar Mar 27 '24 05:03 hey24sheep

+1. I have repeated the whole process of creating the certificates a few times and still the same issue.

sarinupreti2021 avatar Mar 29 '24 08:03 sarinupreti2021

Can anyone of you check if the XCode, MacOS and related versions are same on the hosted pipeline and your local machines?

hey24sheep avatar Mar 29 '24 09:03 hey24sheep

We started seeing issues with the provisioning profile in our pipeline after going from Flutter 3.16 to 3.19.

What versions of Flutter are you all using that are seeing issues?

TyBarthel avatar Mar 29 '24 11:03 TyBarthel

Does it build on previous Flutter versions on the hosted agents for you? If that's the case I will recommend you to create an issue on Flutter's Repo and tag this issue over there for reference.

hey24sheep avatar Mar 29 '24 12:03 hey24sheep

I am also experiencing this issue. I tried downgrading the flutter version to 3.16.9 to see if that resolved the issue. It does not. I am now seeing this with Flutter 3.19.5 and 3.16.9. Started happening when going from macOS-12 to macOS-13.

zach-freeman avatar Mar 29 '24 19:03 zach-freeman

Adding this here to see if it helps for debugging. Locally, I am running Xcode 15.3. On Azure VM macOS-13 the highest Xcode version available is Xcode 15.2 as shown here: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md. Could this be an Xcode issue that was subsequently resolved in Xcode 15.3?

zach-freeman avatar Mar 29 '24 19:03 zach-freeman

We had the issue in multiple flutter projects and were able to resolve it in both by doing the following changes:

File: project.pbxproj (note the quotes) "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "CODE_SIGN_IDENTITY_PLACEHOLDER"; CODE_SIGN_STYLE = Manual; PROVISIONING_PROFILE_SPECIFIER = "PROVISIONING_PROFILE_UUID_ENTERPRISE";

File: ExportOptions.plist signingStyle manual

File: azure-pipelines.yaml Insert the placedholders according to the current signing cert/profile.

TobiasHanitsch avatar Apr 18 '24 11:04 TobiasHanitsch

Hi @TobiasHanitsch @Soap-141 can you please go through these links. I can't help much here as I do not have access to a devops account and neither to a Mac. It could be that there might be a version mismatch on the hosted agents in XCode or MacOS. Could you verify that with your local versions where you could build the IPA.

Usually the profile not found comes when the pipeline for some reason can't find the downloaded profile. But, if you say you had those and this error is different it could be the reason

I got it, I don't remember exactly what it was but it's not your package.

Soap-141 avatar Apr 19 '24 15:04 Soap-141