error: Provisioning profile "iOS Team Provisioning Profile: ..." doesn't support the Associated Domains capability.

Hello, I am having an issue related to provisioning profiles and I am seeking advice on how to resolve it.

This is the error message I am getting:

[06:03:44]: ▸ ❌ error: Provisioning profile "iOS Team Provisioning Profile: com.binnys.universal" doesn't support the Associated Domains capability. (in target 'Runner' from project 'Runner')
[06:03:44]: ▸ ❌ error: Provisioning profile "iOS Team Provisioning Profile: com.binnys.universal" doesn't include the com.apple.developer.associated-domains entitlement. (in target 'Runner' from project 'Runner')

For context, I am building an app using the Flutter framework with an Azure DevOps pipeline for Continuous Integration, and running a fastlane script to build the app. This is my fastlane script below:

default_platform(:ios)

platform :ios do
  desc "Build for iOS"
  lane :prod do
    update_app_identifier(
      xcodeproj: "Runner.xcodeproj",
      plist_path: "Runner/Info.plist",
      app_identifier: "com.binnys.universal",
    )
    update_project_team(
      path: "Runner.xcodeproj",
      teamid: "L3B96G5S7X",
    )
    cert
    sigh(
      force: true,
      app_identifier: "com.binnys.universal",
      filename: "InHouse_com.binnys.universal.mobileprovision",
    )
    build_app(
      scheme: "Prod",
      output_name: "Binder-Prod.ipa",
      export_method: "enterprise",
      export_xcargs: "-allowProvisioningUpdates",
      export_options: {
        compileBitcode: false,
      }
    )
  end
  lane :dev do
    update_app_identifier(
      xcodeproj: "Runner.xcodeproj",
      plist_path: "Runner/Info.plist",
      app_identifier: "com.binnys.universal.dev",
    )
    update_project_team(
      path: "Runner.xcodeproj",
      teamid: "L3B96G5S7X",
    )
    cert
    sigh(
      force: true,
      app_identifier: "com.binnys.universal.dev",
      filename: "InHouse_com.binnys.universal.dev.mobileprovision",
    )
    build_app(
      scheme: "Dev",
      output_name: "Binder-Dev.ipa",
      export_method: "enterprise",
      export_xcargs: "-allowProvisioningUpdates",
      export_options: {
        compileBitcode: false,
      }
    )
  end
end

And this is the relevant part of the build pipeline in Azure DevOps

- job: iOS_Prod
  pool:
    name: Mobile
  steps:
    - task: FlutterInstall@0
      inputs:
        channel: $(flutterchannel)
        version: $(flutterversion)
    - task: InstallAppleCertificate@2
      inputs:
        certSecureFile: $(p12FileName)
        certPwd: $(p12Password)
        keychain: 'temp'
    - script: |
        flutter clean
        cd ios
        pod repo update
        cd ..
      displayName: 'Clean'
      workingDirectory: './binder'
    - task: FlutterBuild@0
      inputs:
        target: 'ios'
        projectDirectory: './binder'
        buildFlavour: 'Prod'
        entryPoint: './lib/main.dart'
        iosCodesign: false
    - script: fastlane prod
      displayName: 'Fastlane'
      workingDirectory: './binder/ios'
    - task: PublishPipelineArtifact@1
      inputs:
        targetPath: './binder/ios/Binder-Prod.ipa'
        artifact: 'iOS_Prod'
        publishLocation: 'pipeline'

When I run the fastlane script locally on my MacBook Pro, I get no errors and the app compiles successfully.

The build agent that we are running the pipeline on is a Mac Mini that our company owns. When I run the fastlane script directly on the Mac Mini, the app also compiles without error. However when running the DevOps pipeline on the same computer (the Mac Mini), using the same fastlane script, it fails with the error above, and I don't understand what could be the difference that causes it to fail.

We have been using this build process for a while, but it is failing now that we have added a feature requiring Associated Domains capability, but again it is only failing when run through the Azure DevOps pipeline.

I don't think that the provisioning profile itself is the issue, because the fastlane script is downloading the latest provisioning profile for the app and it appears to be the correct provisioning profile.

Also the app id has the associated domains capability checked:

And the app has a Runner.entitlements file with the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>aps-environment</key>
   <string>development</string>
   <key>com.apple.developer.associated-domains</key>
   <array>
      <string>applinks:binnys.page.link</string>
   </array>
</dict>
</plist>

If you have any ideas whatsoever on what might be causing this, I would appreciate the help.

Hello,

I've the same issue with an other capability, have you find a solution ?

Hi, same here, something new on this issue?

I had to regenerate our certs… we use fastlane match and the commands were:

bundle exec fastlane match appstore --readonly false --force
bundle exec fastlane match adhoc --readonly false --force
bundle exec fastlane match development --readonly false --force
error: Provisioning profile "iOS Team Provisioning Profile: ..." doesn't support the Associated Domains capability.
 
 
Q