invertase / react-native-firebase-starter

DEPRECATED: For RNFB v5 only.
https://rnfirebase.io/docs
Other
1.17k stars 334 forks source link

[Firebase/Core][I-COR000005] No app has been configured yet. #106

Closed TheSavior closed 5 years ago

TheSavior commented 5 years ago

When following the instructions in the getting started my app loads, but I'm not able to anonymously authenticate in JS.

I uncommented these lines from the starter (and rearranged it to not use await)

firebase.auth().signInAnonymously().then(({user}) => {
      console.warn('User -> ', user.toJSON());
    });

and I get this error:

Simulator Screen Shot - iPhone XS - 2019-04-11 at 22 43 17

It looks like it is related to the build warnings in xcode:

2019-04-11 22:32:59.867587-0700 DailyTracker[59238:884395] 5.20.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
2019-04-11 22:32:59.909820-0700 DailyTracker[59238:884395] 5.20.0 - [Firebase/Core][I-COR000005] No app has been configured yet.

I believe I followed the getting started instructions completely (although clearly not haha). Specifically I imagine this is part of these instructions:

3.1) [iOS] Follow the add firebase to your app instructions here to generate your GoogleService-Info.plist file if you haven't done so already - use the package name generated previously as your iOS bundle ID.
3.2) [iOS] Place this file in the ios/ directory of your project.

I went through that set up and copied GoogleService-Info.plist into my ios directory:


$ ls -lah ios
.
..
DailyTracker
DailyTracker-tvOS
DailyTracker-tvOSTests
DailyTracker.xcodeproj
DailyTracker.xcworkspace
DailyTrackerTests
GoogleService-Info.plist
Podfile
Podfile.lock
Pods
build

And then did the build through xcode to get the warnings above.

What step am I missing here? Is the starter template or instructions missing some set up?

Salakar commented 5 years ago

Hey again @TheSavior πŸ‘‹

I think I see the problem, it's a fairly common thing so no worries; adding the plist file via finder doesn't link it in Xcode annoyingly, you'll need to also add it via the Xcode UI (right click project > add files)

I'm actually adding a better warning for this in the next major version so hopefully this will help others coming across this πŸ™ˆ

TheSavior commented 5 years ago

Hi! πŸ‘‹

The instructions on the website should probably be a bit more specific to make sure people do this correctly too.

I interpreted Place this file in the ios/ directory of your project. to mean that cp ~/Downloads/GoogleService-Info.plist ios would work. :)

Salakar commented 5 years ago

😫 you're right, looks like the starter guides are still a bit out of date, I did update the main docs a while back, guess I've missed this one, doh.

Have updated all the occurrences now; thank you for the feedback πŸŽ‰

image

TheSavior commented 5 years ago

Ooh. That's much more clear. Nice. πŸ‘