-
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
firebase.options.projectId is null on Android #446
Comments
@calclavia can you debug on this line on android: https://github.com/invertase/react-native-firebase/blob/master/android/src/main/java/io/invertase/firebase/RNFirebaseModule.java#L144 See if |
@calclavia any update on this? |
@Salakar Here's the output when I print it out in Java. Seems like the output project name is null.
|
Just checked this on my end, for me it's giving me the projectId value - can you check your google services .json file and see if the projectId field is in there? project_info > project_id on my json file. |
@Salakar Yes. In my Android google services I have the project_id set correctly. |
@calclavia just to confirm is this for the default app? Or is this a new additional apps you're initialising via JS? |
@Salakar default app |
Have confirmed this is working on the latest release for both platforms, will close. |
I've encountered this problem using
Strangely enough, all functionality associated with the standard firebase database works as expected. After initializing using As per good old StackOverflow, this can be resolved by using the following
(I was using |
@Salakar I am still getting this error when trying to use dynamic links. I am using:
The only thing I did differently was reference version 9.8.0 instead of 11.6.0 (per the documentation). This was because I have recently detached to expoKit so I had a bunch of other play-services9.8.0 references in that file. So when I attempted to build in AndroidStudio I got a nice version mismatch error. Expos docs strongly suggest downgrading to meet them so I did to get around the error. All in all in the project/app/build.gradle file I changed the following lines from 11.6.0 to 9.8.0
I have a hard time believing that this is causing the No virtual method getProjectId() error but it's the only thing I can think of where I have strayed from the docs. Please let me know of anything else you might want to inquire about my environment. Any guidance, advice, or workarounds would be appreciated. |
@jakenolan I'm afraid to say that this will almost certainly be because you've downgraded the version to 9.8.0 - this version was released in October 2016, so any methods that have been added since then won't be available. I'd imagine that |
@jakenolan Yes, all the play services need to run at the same version. |
@chrisbianca Thanks for the clarification. When I attempt to roll everything up to 11.6.0 and deploy my app via AndroidStudio the app dies before opening with this exception: E/AndroidRuntime: FATAL EXCEPTION: Thread-9 Any thoughts on this? |
@jakenolan Looks like this is a problem with the |
@chrisbianca I mean I am not "using" it for anything at all it was just something already in my project/app/build.gradle file. I attempted just removing this line:
However I was left with this: E/AndroidRuntime: FATAL EXCEPTION: main I did notice other exceptions above this fatal one that I hadn't noticed before but I am unsure if they are significant. They are as follows: E/FA: Task exception on worker thread: java.lang.NoClassDefFoundError: com.google.android.gms.common.zzj: com.google.android.gms.internal.zzcjr.zzbaj(Unknown Source) E/ExpoApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.ComponentName android.content.Intent.getComponent()' on a null object reference P.S. Thank you so much for your help. I apologize if I am coming off as a noob or overlooking simple things. |
@jakenolan Not at all, RN can be somewhat frustrating and unfortunately in this case I'm not sure there's going to be a simple way to resolve it. Taking a look at the Expo code, they have explicitly set the play services to v9.8.0 and are clearly relying internally on this specific version being available: https://github.com/expo/expo/blob/master/android/app/build.gradle Without getting Expo to update their version, I'm not sure there's going to be way to get Expokit playing nicely without RNFirebase. |
Issue
I noticed that on Android firebase.options.projectId is always null. On iOS the value is correct and gives me my project ID.
Environment
Android
MacOS Sierra
Android
0.43.4
3.0.0-alpha.5
Core
The text was updated successfully, but these errors were encountered: