Firebase Firestore doesn't allow archiving on Xcode 11. After trying to archive my app multiple times and changing build settings, cleaning pods, uninstalling and reinstalling my pods, deleting the derived data folder, cleaning the build folder, and restarting Xcode and my computer, the archiving process always gets stuck on an arbitrary task while archiving with FirebaseFirestore. I've let the bar hang on that task for around 2 hours and it hasn't moved to the next task so I'm assuming it never will.
What happened? How can we make the problem occur?
This could be a description, log/console output, etc.
Using Xcode 11, archive an app that has the FirebaseFirestore pod installed
N/A
I'm able to archive the Firestore quick start with Xcode Version 11.0 (11A419c)
Perhaps, the Xcode is in a bad state? - clean and rm -rf ~/Library/Developer/Xcode/DerivedData/
Before filing this bug report I cleaned the DerivedData folder and the issue still occurred. Other people are also experiencing this problem:
https://stackoverflow.com/questions/57881459/building-archiving-for-release-hangs-indefinitely-in-xcode-11#comment102411601_57881459
@CentrumGuy Are you able to archive the Firestore quick start?
Yeah, I just tested the Firestore quickstart on Xcode 11, GM seed 2 and was able to archive the project
I tried adding some of the pods from my other project that has this issue. The podfile for my FirestoreExample project now looks like this:
platform :ios, '8.0'
target 'FirestoreExample' do
use_frameworks!
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'FirebaseUI/Auth'
pod 'FirebaseUI/Email'
pod 'Firebase/Firestore'
pod 'SDWebImage'
pod 'IQKeyboardManagerSwift'
pod 'Hero'
pod 'Firebase/Core'
pod 'Firebase/Storage'
pod 'Firebase/Messaging'
pod 'Firebase/Functions'
pod 'Firebase/RemoteConfig'
pod 'Alamofire', '~> 4.7'
pod 'paper-onboarding'
pod 'MarqueeLabel/Swift'
pod 'lottie-ios'
pod 'Firebase/InAppMessagingDisplay'
pod 'Fabric'
pod 'Crashlytics'
pod 'SwiftSoup'
end
During archiving, Xcode now gets stuck on task 5309 of 5409 with a process for "FirebaseUI". Seeing that this is an issue with a different Firebase framework than my other project and that this issue happens with the addition of other pods, I'm thinking that this might be due to two firebase pods interfering with one another. I'm not really an expert on the matter and I don't know if that's even a possibility but I'm writing it here because I think it's worth taking a look at.
Bonus
Now storyboards containing IBDesignables don't render. Issue mentioned here: #3883
I have a similar issue, but for me it gets stuck on FirebaseInstanceId during archiving.
It seems the issue is inconsistent in which pod it happens in per project. In terms of Firebase pods I have only “Firebase/Analytics” and “Firebase/AdMob” added to my podfile.
@CentrumGuy The issue reproduces for me with that Podfile on the Firestore quickstart. The build hangs after FirebaseUI finishes building with two swift jobs running at 100% in Activity Manager.
Since the infinite loop is definitely an Xcode problem, I recommend sending an issue to Apple.
I sent a bug report to Apple. I will update this issue when they respond. Are you sure this has nothing to do with Firebase?
Thanks for sending the bug report.
There's definitely an Apple bug since Xcode shouldn't infinite loop no matter what input it gets.
It's possible something about the Firebase pods are causing an incorrect Xcode workspace, but in that case, it's more likely a CocoaPods issue, since the Firebase pods work fine in smaller Podfile subsets.
If it's any help figuring out the issue (or a workaround), I've tried to archive my project containing Firebase pods using the xcodebuild command line tool and it hangs at the following output:
Touch /Users/<USERNAME_OMITTED>/Library/Developer/Xcode/DerivedData/MyTestApp-fhxgnkivetrgngfjuuwajxlzpalb/Build/Intermediates.noindex/ArchiveIntermediates/MyTestApp/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/FirebaseInstanceID.framework (in target 'FirebaseInstanceID' from project 'Pods')
cd /Users/<USERNAME_OMITTED>/Desktop/AppDev/MyTestApp/Pods
/usr/bin/touch -c /Users/USERNAME_OMITTED>/Library/Developer/Xcode/DerivedData/MyTestApp-fhxgnkivetrgngfjuuwajxlzpalb/Build/Intermediates.noindex/ArchiveIntermediates/MyTestApp/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/FirebaseInstanceID.framework
It seems like it's hanging on a simple touch command, but if I run this touch command seperately from the terminal, it works fine.
It also seems this hang isn't necessarily related to the archive process itself but to the build process it relies on. It happens anytime you build the project for release, even when not related to archiving.
For example the following simple build command works fine:
xcodebuild -workspace MyTestApp.xcworkspace -scheme MyTestApp -sdk iphoneos -configuration Debug build
While the following command hangs:
xcodebuild -workspace MyTestApp.xcworkspace -scheme MyTestApp -sdk iphoneos -configuration Release build
I think I found the culprit.
I checked the podfile shared by @CentrumGuy and it seems the only pods the file and my project have in common are Firebase and SwiftSoup. It seems other SwiftSoup users had some issues with hangs as well ( https://github.com/scinfu/SwiftSoup/issues/116 and https://github.com/scinfu/SwiftSoup/issues/125 ).
The issue seems to stem from a bug in the Swift optimizer code which has been fixed here https://github.com/apple/swift/commit/378c6adbd625f1c1f568fa28116be3335506082f#diff-8b0154fba360507e6f59f3a0c8e98d1a but hasn't made it to XCode yet.
Removing SwiftSoup from my podfile and regenerating the pods project (using pod update) solved the issue.
Adding the SwiftSoup source files to the project manually caused archiving to hang again.
Hopefully either SwiftSoup or Apple comes with a new release fixing this issue soon.
(until then I've switched to Kanna for XML/HTML parsing)
Good find @leonluc-dev! Thanks!
Closing in favor of https://github.com/scinfu/SwiftSoup/issues/125 and an Xcode update for the Swift compiler
Most helpful comment
I think I found the culprit.
I checked the podfile shared by @CentrumGuy and it seems the only pods the file and my project have in common are Firebase and SwiftSoup. It seems other SwiftSoup users had some issues with hangs as well ( https://github.com/scinfu/SwiftSoup/issues/116 and https://github.com/scinfu/SwiftSoup/issues/125 ).
The issue seems to stem from a bug in the Swift optimizer code which has been fixed here https://github.com/apple/swift/commit/378c6adbd625f1c1f568fa28116be3335506082f#diff-8b0154fba360507e6f59f3a0c8e98d1a but hasn't made it to XCode yet.
Removing SwiftSoup from my podfile and regenerating the pods project (using
pod update) solved the issue.Adding the SwiftSoup source files to the project manually caused archiving to hang again.
Hopefully either SwiftSoup or Apple comes with a new release fixing this issue soon.
(until then I've switched to Kanna for XML/HTML parsing)