Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building/archiving for release hangs indefinitely in Xcode 11

I'm trying to release an iOS app - it builds fine on simulator or device in Xcode 11, and can be archived fine in Xcode 10, but when I try to archive it for release in the App Store the build hangs indefinitely. I hit Product > Archive, it completes 3960 out of 4040 steps, and then hangs in indefinitely at the stage of "Archiving Firebase/Firestore". This is happening on 4 different Xcode 11 versions - 3,6,7 and most recently the GM that was released earlier today.

I've tried flipping a bunch of the build settings - the Optimization flags, incremental/whole modules, enabling Bitcode, exclusive memory, and have also reinstalled Xcode with different 11 versions a few times. I've also tried this with various versions of cocoapods, including the Firebase/Firestore pod that is being compiled when the build hangs (i.e., I've used an old version and tried updating to the latest version of the pod) Nothing I've done has worked. Does anyone have any advice for other things I could try to stop this from hanging?

like image 492
milohoffman Avatar asked Sep 11 '19 02:09

milohoffman


People also ask

Why I can't archive in Xcode?

Archive menu option grayed out If you can't create an archive in Xcode, usually it's because you have the destination set to the simulator. Switch to an iOS device (it should work even if you don't have one connected). Another cause for the grayed-out archive option is that it's disabled for your scheme.

How do I turn off archive in Xcode?

On the Xcode menu, select Product -> Edit Scheme... In the Build section, add the new target, then uncheck all the boxes except the one in the Archive column. This ensures the script will only be run on Archive. (See this question for an explanation and a nice screenshot.)

Do I need to Build before archive Xcode?

Make sure your build is successfulBefore beginning to archive your build, you need to make sure that the build is successful not only for Debug, for also for Release.

How do I archive an app in Xcode?

The Archive action is disabled for your app in the scheme editor's Build pane. In Xcode, open the scheme editor by choosing Product > Scheme > Edit Scheme…, then select the Archive action for your app in the Build pane as shown in Figure 1. Note: Be sure to select your app's scheme from the scheme pop-up menu in the upper-left corner ...

How do I know if my Xcode archive is a generic?

If the Archives Organizer shows Upload to App Store and Validate as shown in Figure 5, then your archive is likely a generic Xcode archive rather than an app archive. You cannot package generic archives nor submit them for review.

Why does my Xcode archive contain header files?

Your archive contains header files. If your app links against a static library, then your archive contains header files because the library probably uses a Headers build phase to export these files as shown in Figure 4. Headers build phases do not work correctly with static library targets when archiving in Xcode.

Why is the archive menu item grayed out in Xcode?

Why is the Archive menu item grayed out in Xcode ? The Archive menu item may be grayed out in Xcode for any of the following reasons: The Archive action is disabled for your app in the scheme editor's Build pane.


Video Answer


3 Answers

@leonluc-dev tracked this infinite loop down to a Swift compiler bug building the SwiftSoup CocoaPod.

Full description here.

See this answer for a screen shot of disabling optimization of Swift Soup to work around.

like image 27
Paul Beusterien Avatar answered Oct 20 '22 18:10

Paul Beusterien


If you're also using Firebase Crashlytics, moving

"${PODS_ROOT}/FirebaseCrashlytics/run"

after

"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols"

in your Run Script phase should solve the issue.

like image 129
thefabbulus Avatar answered Oct 20 '22 17:10

thefabbulus


It seems to be a bug with Xcode 11. I reported the issue to the Firebase team over here: https://github.com/firebase/firebase-ios-sdk/issues/3884#issuecomment-533663539

and I also reported the issue to Apple using feedback assistant (bug FB7303206). I'll update this answer when Apple responds.

like image 39
CentrumGuy Avatar answered Oct 20 '22 17:10

CentrumGuy