The default FirebaseApp instance must be configured before the defaultFirebaseApp instance can be initialized
Firebase team member here. Most people who are running into this error have accidentally linked two copies of Firebase into their application, usually one in the app target and one in a dynamic framework dependency target. You can check if you have two copies of Firebase linked into your app by checking your runtime logs for duplicate class definition warnings. If you see warnings like
objc[40943]: Class FIRApp is implemented in both
~/Library/Developer/Xcode/DerivedData/FrameworkTest-apqjxlyrxvkbhhafhaypsbdquref/Build/Products/Debug-iphonesimulator/DynamicFramework.framework/DynamicFramework
(0x10b2a87f8) and
~/Library/Developer/CoreSimulator/Devices/4821F959-24A6-4D78-A102-4C5703103D99/data/Containers/Bundle/Application/F017D210-113A-4DAF-9E17-BDE455E71E06/FrameworkTest.app/FrameworkTest
(0x10ad2d348). One of the two will be used. Which one is undefined.
then that means you have two copies of Firebase in your app runtime. Previously this would not crash your app, but could lead to other undefined behavior like dropped Analytics events. We recently made a change in FirebaseInstallations that caused this to crash at launch. If you downgrade your Firebase version dependency, you will still have undefined behavior even if your app does not crash at launch.
Unfortunately, you'll either have to abandon the dynamic framework approach and link all dependencies directly into your app or you'll have to change your dynamic framework into a static one. In the future, we'll explore distributing Firebase as a dynamic dependency so that users can link it into dynamic frameworks without worry of duplicating class definitions at runtime.
See this doc on the Firebase iOS SDK GitHub for more details.
Edit: You can now choose to link Firebase either statically or dynamically via CocoaPods. See this document for more details: https://firebase.google.com/docs/ios/link-firebase-static-dynamic