Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FirebaseFirestore Prevents Project From Archiving #3884

Closed
CentrumGuy opened this issue Sep 19, 2019 · 12 comments
Closed

FirebaseFirestore Prevents Project From Archiving #3884

CentrumGuy opened this issue Sep 19, 2019 · 12 comments

Comments

@CentrumGuy
Copy link

[READ] Step 1: Are you in the right place?

  • For issues or feature requests related to the code in this repository
    file a Github issue.
    • If this is a feature request make sure the issue title starts with "FR:".
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 11.0
  • Firebase SDK version: 6.8.1
  • Firebase Component: Firestore (Auth, Core, Database, Firestore, Messaging, Storage, etc)
  • Component version: 1.5.0

[REQUIRED] Step 3: Describe the problem

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.

Steps to reproduce:

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

Relevant Code:

N/A

@paulb777
Copy link
Member

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/

@CentrumGuy
Copy link
Author

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

@paulb777
Copy link
Member

@CentrumGuy Are you able to archive the Firestore quick start?

@CentrumGuy
Copy link
Author

Yeah, I just tested the Firestore quickstart on Xcode 11, GM seed 2 and was able to archive the project

@CentrumGuy
Copy link
Author

CentrumGuy commented Sep 19, 2019

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

@leonluc-dev
Copy link

leonluc-dev commented Sep 20, 2019

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.

@paulb777
Copy link
Member

@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.

@CentrumGuy
Copy link
Author

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?

@paulb777
Copy link
Member

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.

@leonluc-dev
Copy link

leonluc-dev commented Sep 21, 2019

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

@leonluc-dev
Copy link

leonluc-dev commented Sep 21, 2019

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 ( scinfu/SwiftSoup#116 and scinfu/SwiftSoup#125 ).

The issue seems to stem from a bug in the Swift optimizer code which has been fixed here apple/swift@378c6ad#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)

@paulb777
Copy link
Member

Good find @leonluc-dev! Thanks!

Closing in favor of scinfu/SwiftSoup#125 and an Xcode update for the Swift compiler

@firebase firebase locked and limited conversation to collaborators Oct 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants