Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing Provisioning Profile error when archiving using xcodebuild

to automate my app build process, I am trying to build my iOS app via command line

Build command

xcodebuild archive -project sample.xcodeproj -scheme "sample" -archivePath $PWD/archive/sample.xcarchive -destination generic/platform=iOS -UseModernBuildSystem=NO

Export Command

xcodebuild -exportArchive -archivePath $PWD/archive/sample.xcarchive -exportOptionsPlist ./ExportOptions.plist -exportPath $PWD/build -UseModernBuildSystem=NO

Following is the error

Error Domain=IDEProvisioningErrorDomain Code=9 ""sample.app" requires a provisioning profile." UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription="sample.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}

Please note that the archive from Xcode works fine. And the Info.plist file from archive folder archive/sample.xcarchive/Info.plist does not contain provisioning profiles dictionary.

As per other suggestions on google and StackOverflow, I have tried the following

  1. Changed build settings to Legacy build
  2. Removed Provisioning profiles folder from ~/Library/MobileDevice
  3. Upgraded Xcode to latest (currently 11.4)
  4. created a softling of ~/Library/MobileDevice in /Library/MobileDevice
  5. Recreated provisioning profile in developer account.

Could anyone help me get over this issue?

like image 232
blganesh101 Avatar asked Oct 22 '25 03:10

blganesh101


2 Answers

What has finally worked is to remove wildcard while mentioning the App id in the exportOptions.plist file.

<?xml version="1.0" encoding="UTF-8"?>
<dict>
    <key>provisioningProfiles</key>
    <dict>
        <key>APP_ID_WITHOUT_WILDCARD_CHAR</key>
        <string>PROVISIOING_PROFILE_NAME_AS_SEEN_BY_XCODE</string>
    </dict>
    <key>method</key>
    <string>app-store</string>
    <key>signingCertificate</key>
    <string>iPhone Distribution</string>
    <key>signingStyle</key>
    <string>manual</string>
    <key>stripSwiftSymbols</key>
    <true/>
    <key>teamID</key>
    <string>TEAM_ID</string>
    <key>uploadSymbols</key>
    <true/>
</dict>
</plist>
like image 119
blganesh101 Avatar answered Oct 24 '25 17:10

blganesh101


I got the same error after upgrading to XCode 11.3. It's related to new Apple Development and Apple Distribution certificate types.

Edit provisioning profile and select use in Xcode 11. Use this new provisioning profile to fix this error.

like image 23
Parag Bafna Avatar answered Oct 24 '25 19:10

Parag Bafna