-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Unable to initialize #9
Comments
initizlizeApp in RNFirebase doesn't work like the web SDK. The docs need an update, as they don't accept the parameters as shown. You need to add an app on the firebase console, and add the |
Could you be more specific? |
@lobo922 you also need to add google services to your gradle files, otherwise it won't get loaded |
Closing this and making a note to update the android setup docs. @lobo922 if you still have an issue please reply and i'll re-open. |
I'm getting the run-time error: "Default FirebaseApp is not initialized in this process com.react_native. Make sure to call FirebaseApp.initiailizeApp(Context) first" |
@hynese have you added Firebase to the to the delegate file? |
@Ehesp Thank you for your reply. I somehow managed to get it to work. I think I wasn't pulling in google-services correctly. Here are my notes:
|
@hynese any chance you'd be able to review the installation docs on here and let me know if anything was missing based on your experience? |
I am having this issue too. Any updates? |
@bakr-baroudi have you followed the setup instructions from the readme for the platform you're on? |
Hi @Salakar, what do you mean by this:
|
As the firebase documentation says when you setup an Android project, you need to include Google Services in your project: https://github.com/invertase/react-native-firebase-tests/blob/master/android/build.gradle#L9 |
Also @bakr-baroudi
Where are you reading this from? EDIT: Mybad. This was pulled from Firestack. Needs changing. |
@bakr-baroudi I have updated the docs now, can you look over them again and see if anything has been missed your end: https://github.com/invertase/react-native-firebase/blob/master/docs/firebase-setup.md |
Ah that's because you've set your emulator up with no Google Services. Make
sure services are downloaded under SDK manager then make a new emulator
with services enabled.
…On 7 Apr 2017 03:58, "bakr-baroudi" ***@***.***> wrote:
Thanks guys for replying. @Salakar <https://github.com/Salakar> @Ehesp
<https://github.com/Ehesp>
I am still getting this issue on Nexus 6A emulator (API 6.0).
Error Msg => "Google Play Services is required to run this application but
no valid installation was found".
I change the debugging into my real device (API 7.0) then it works.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAzZXqP63RjzAVsho4LKAsiRk7zvXQqZks5rtaZngaJpZM4MhiZv>
.
|
@bakr-baroudi for clarity, your emulators need to include "Google APIs" once you'd installed via SDK manager: |
Wait a sec I am confused. My iOS app is working fine and I am passing the configuration information in js. The android app is not and is giving the not initialized error. From what I am reading here, you are saying I can't configure this in js? I HAVE to configure this in JS as the connection information is coming down via json based on the tenant they have authenticated in to. So how do I configure this without hardcoding the app, which is not an option. |
@victoriafrench That's an interesting use case that we hadn't envisaged! At the moment, as you've found, the initialisation relies on the We can certainly look at supporting custom configuration, we'd just been trying to keep it simple at first. Out of interest, are you needing to connect to multiple projects simultaneously? Or is there only one project active at any one time? |
Is there any resolution for this? My iOS app works fine with dynamic configuration through JS but the Android app does not. I need to connect to a different firebase app based on my app's environment configuration and cannot have a static google-services.json file. Why have the firebase.initializeApp() function if it does not work on Android? |
I'm trying to initialize Firebase from JS as following:
componentWillMount() {
firebase.initizlizeApp({
apiKey: 'apikey',
authDomain: 'authdomain',
databaseURL: 'dburl',
storageBucket: 'bucket',
messagingSenderId: 'senderid'
});
}
componentWillMount() {
const firebase = new RNFirebase();
const configurationOptions = {
debug: true,
googleAppID: 'appid',
APIKey: 'appkey',
databaseURL: 'dburl',
storageBucket: 'bucket',
androidClientID: 'clientid',
GCMSenderID: 'senderid'
};
const firebase = new RNFirebase(configurationOptions);
}
But in both attemps i get the following error on the emulator:
Default FirebaseApp is not initialized in this process com.xxx. Make sure to call FirebaseApp.initializeApp(Context) first. getInstance null:-1 getInstance null:-1 <init> RNFirebaseAuth.java:50 createNativeModules RNFirebasePackage.java:38 processPackage NativeModuleRegistryBuilder.java:88 processPackage ReactInstanceManager.java:950 createReactContext ReactInstanceManager.java:891 access$600 ReactInstanceManager.java:104 doInBackground ReactInstanceManager.java:218 doInBackground ReactInstanceManager.java:197 call AsyncTask.java:304 run FutureTask.java:237 runWorker ThreadPoolExecutor.java:1133 run ThreadPoolExecutor.java:607 run Thread.java:761
Am i doing anything wrong?
The text was updated successfully, but these errors were encountered: