Reputation: 2495
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:
The 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.
Upvotes: 6
Views: 4745
Reputation: 184
We also faced a similar issue when trying to archive the build when a third party extension present.
Our solution was to
Append signing certificate details to existing exportOptions.plist. This ensures we can sign the entire package while exporting.
Archive package without signing
Sign only the our part of the app without the third party package. This is done by going into the created archive file and then signing the .app
file created during above archiving process. We also had to create a separate file called entitlements.plist to specify entitlements available for the app while signing.
Finally export the app using information specified in ExportOptions.plist
while signing the whole package again.
- script: /usr/libexec/PlistBuddy -c "Add :signingCertificate string $(APPLE_CERTIFICATE_SIGNING_IDENTITY)" ios/ExportOptions.plist
displayName: 'Append ExportOptions.plist file'
- script: xcodebuild archive -scheme 'demoapp' -sdk iphoneos -configuration 'Release' -workspace 'ios/demoapp.xcworkspace' -allowProvisioningUpdates -archivePath demoApp.xcarchive CODE_SIGNIN_REQUIRED=Yes CODE_SIGNING_ALLOWED=No
displayName: 'Archive'
- script: codesign --entitlements ios/entitlements.plist -f -s "$(APPLE_CERTIFICATE_SIGNING_IDENTITY)" "demoApp.xcarchive/Products/Applications/Demo.app"
displayName: 'Code Sign with entitlements'
- script: xcodebuild -exportArchive -archivePath demoApp.xcarchive -exportPath ios -exportOptionsPlist ios/ExportOptions.plist
displayName: 'Export IPA'
Find more details in this write up. https://medium.com/@pramodyahk/building-a-react-native-ios-app-with-azure-devops-pipeline-688f621ab1d3
Upvotes: 1
Reputation: 5918
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.
Upvotes: 2
Reputation: 776
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>
Upvotes: 13
Reputation: 3667
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!
Upvotes: 1