Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode stuck on embedding provisioning profile

Today I updated my Xcode to the version 9.3 (9E145). After that I created an archive and now I am trying to export it for development. However I see Xcode stuck on the following step:

XCode message

Is it a bug of Xcode 9.3? How can I solve it?

like image 348
Roman Podymov Avatar asked Apr 11 '18 07:04

Roman Podymov


4 Answers

Xcode seems to be recompiling the bitcode while showing this message and it can, therefore, take a very long time to "embed the provisioning profile". If you wait patiently for a very long time, depending on the size of your codebase (including dependencies from Carthage or Cocoapods), it will eventually continue.

@AllanWeir's answer explicitly disables the bitcode compilation by recommending to do so in the plist file, so the time improvement seems to have been an inadvertent side effect. "Fixing" this does NOT require using the command line to export.

I think previous Xcode versions gave more helpful statuses during bitcode re-compilation.

You can disable the bitcode compilation during Xcode export via the UI and it will no longer get "stuck".

enter image description here

like image 171
allenh Avatar answered Nov 08 '22 14:11

allenh


Xcode Version 9.3.1 (9E501)

As for me, I needed to wait some time (around 3-5 minutes) to finally recompile bitcode. Looks like you have to wait some time to get it done.

like image 27
atereshkov Avatar answered Nov 08 '22 13:11

atereshkov


This issue is happening for me on Xcode 9.3 too and it looks like using xcodebuild from the terminal works as expected.

You can export an archive by running (replacing the archive path)

xcodebuild -exportArchive -archivePath "YOUR_XCODE_ARCHIVE_FOLDER/YOUR_ARCHIVE.xcarchive" -exportPath "output/"  -exportOptionsPlist "ExportOptions.plist"

You'll need to set up an ExportOptions.plist file with a minimum of:

  • 'method' set to either 'app-store', 'enterprise', 'ad-hoc' or 'development'
  • 'compileBitcode' set to FALSE
  • For manual signing you will need to add your team and provisioning details

More info on Export Options is available here EXPORT .XCARCHIVE TO .IPA USING XCODEBUILD...

My ExportOptions.plist looks like (replace the bundle ID, provisioning profile, team ID and possibly the signingCertificate value):

<?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>compileBitcode</key>
    <false/>
    <key>method</key>
    <string>enterprise</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>COM.YOUR-BUNDLE-ID</key>
        <string>YOUR PROVISIONING PROFILE NAME</string>
    </dict>
    <key>signingCertificate</key>
    <string>iPhone Distribution</string>
    <key>signingStyle</key>
    <string>manual</string>
    <key>teamID</key>
    <string>YOUR TEAM ID</string>
</dict>
</plist>
like image 2
Allan Weir Avatar answered Nov 08 '22 14:11

Allan Weir


I am on xcode 9.4. My codebase is considerably big too.

Mine took about 20 minutes to export. But Just like @Allen Humphreys mentioned, if the "Rebuild from Bitcode" is unchecked in the options, it exports quickly(for me in just a minute or two).

like image 1
anoo_radha Avatar answered Nov 08 '22 14:11

anoo_radha