"App.framework does not support provisioning profiles" when trying to build my flutter app with codemagic
Asked Answered
W

3

6

I'm trying to build and release my flutter app for development purposes (to test it with testmagic) with codemagic (because I'm using a windows machine). But everytime I build the app the step build fails and the following error shows up:

Unable to export archive: 2020-01-05 05:46:47.914 xcodebuild[1398:9643] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/Runner_2020-01-05_05-46-47.912.xcdistributionlogs'. error: exportArchive: App.framework does not support provisioning profiles. Error Domain=IDEProvisioningErrorDomain Code=10 "App.framework does not support provisioning profiles." UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription=App.framework does not support provisioning profiles., NSLocalizedRecoverySuggestion=App.framework does not support provisioning profiles, but provisioning profile {Name of the App + ID} has been manually specified. Remove this item from the "provisioningProfiles" dictionary in your Export Options property list.} ** EXPORT FAILED **

There's a part in the error message which says I should remove and item from the provisioningProfiles dictionary:

 Remove this item from the "provisioningProfiles" dictionary in your Export Options property list.

I don't understand what this means. I've tried with deleting the automatic generated provisioning profile from my apple developer account but this doesn't work.


The build settings:

codemagic build settings

The code signing settings:

codemagic code signing settings

I don't have any idea why this is happening. I found some github issues about a similar probelm on the internet but every issue is still open and not active or for xcode users and I'm not using xcode.

Wey answered 5/1, 2020 at 14:4 Comment(10)
Hi, can you check your podfile and this solution? github.com/CocoaPods/CocoaPods/issues/…Phobos
Hey. Where should this podfile be? Can't find it.Wey
usually in ios folder if you use cocoapodsPhobos
I don‘t use it thats the funny part. I don‘t even know what this is..Wey
Hi, we need additional info like build link to help with this question. But I guess it's better to continue in Codemagic slack community. You can find the link on Codemagic sitePhobos
@MikhailTokarev Thank you for your help. I change to your slack channel.Wey
Did you find the fix? Would you be so kind to share it with us (as an answer on your own question)?Scylla
I haven't found a solution so I've bought an old iMac to build my app because I've lost patience with codemagic.Wey
Wow, that tough to hear. I hope I'll find a fixScylla
@Floris I'll try it again one day because codemagic would be an amazing solution to automatically build and deploy apps but for now my iMac is doing the job.Wey
W
12

Old issue but I think this solution should apply to people who stumble upon this again. Usually this only affects users that are trying to build without a Mac and then they edit every instance of 'BundleIdentifier' they can find.

The fix is to open up your AppFrameworksInfo.plist file and change the CFBundleIdentifier to io.flutter.flutter.app instead of your bundle ID.

<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
Wincer answered 30/10, 2020 at 15:33 Comment(1)
This my good sir has been a life saver. Have been banging my head the whole day trying to get things to build and this finally got it to work. Thanks !Doxia
C
2

If you are using CI/CD (e.g Azure DevOpps) and passing xcodebuild command line build configuration arguments, e.g PRODUCT_BUNDLE_IDENTIFIER or PROVISIONING_PROFILE_SPECIFIER it will be also be passed downn to the other pods projects. As @arnold-veltmann said here the culprit is passing PRODUCT_BUNDLE_IDENTIFIER to projects (pods) that do not support signing. In my case it's for a project using Ionic 5 with Capacitor which make uses of cocoapods.

The usual post_install solution in pods file did not work for me

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
      config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
      config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
      end
    end
end

Although I did check and the post_install run and sets the build config correctly.

What I ended up doing was create a custom build setting e.g SP_PRODUCT_BUNDLE_IDENTIFIER and pass it in the azure devops yaml pipeline xcode build step

 - task: Xcode@5
    displayName: 'Build iOS app'
    inputs:
      actions: 'build'
      configuration: 'Appcenter'
      sdk: 'iphoneos'
      xcWorkspacePath: 'ios/App/App.xcworkspace'
      scheme: 'App'
      xcodeVersion: '11'
      packageApp: true
      archivePath: './output'
      exportPath: './output'
      exportOptions: 'plist'
      exportOptionsPlist: './_deploy/Appcenter-ExportOptions.plist'
      signingOption: 'default'
      args: SP_PRODUCT_BUNDLE_IDENTIFIER=$(bundleIdentifier) SP_PROVISIONING_PROFILE_SPECIFIER=$(iosProvisioningProfile)

Afterwards in the project.pbxproj I've located my build configuration used for Appcenter (CI/CD) build and set

E6D3FFF3256E6D8500109D05 /* Appcenter */ = {
            isa = XCBuildConfiguration;
            baseConfigurationReference = A158677F50F9AF6793C0B6F1 /* Pods-App.appcenter.xcconfig */;
            buildSettings = {
                ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
                CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
                CODE_SIGN_IDENTITY = "iPhone Distribution";
                CODE_SIGN_STYLE = Manual;
                DEVELOPMENT_TEAM = B982UY6B4T;
                INFOPLIST_FILE = App/Info.plist;
                IPHONEOS_DEPLOYMENT_TARGET = 12.0;
                LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
                PRODUCT_BUNDLE_IDENTIFIER = "$(SP_PRODUCT_BUNDLE_IDENTIFIER)";
                PRODUCT_NAME = "$(TARGET_NAME)";
                PROVISIONING_PROFILE_SPECIFIER = "$(SP_PROVISIONING_PROFILE_SPECIFIER)";
                SWIFT_ACTIVE_COMPILATION_CONDITIONS = USE_PUSH;
                SWIFT_VERSION = 5.0;
                TARGETED_DEVICE_FAMILY = 1;
            };
            name = Appcenter;
        };

Notice the PROVISIONING_PROFILE_SPECIFIER = "$(SP_PROVISIONING_PROFILE_SPECIFIER)";

I hope this helps someone, because I spent 1 day, building a thousand times and failing 1001 more.

Conchita answered 12/6, 2021 at 20:33 Comment(0)
S
1

It's not a direct answer to you question, but I managed to create a build pipeline for the Flutter Android & IOS app starter-template without the need for a physical macOS device.

All steps with the source code are documented here.

Hope this helps!

Scylla answered 10/5, 2020 at 13:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.