Do I need Firebase Core for Firebase Database? - android

I use only Firebase Database and I've added only the next dependency:
implementation 'com.google.firebase:firebase-database:16.0.1'
it seems works ok
but during compilation I get next warning
Warning: The app gradle file must have a dependency on
com.google.firebase:firebase-core for Firebase services to work as
intended.
Should I still add Core? like:
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'

Yes, you have to explicitly list it now:
Update - June 12, 2018
Your app gradle file now has to explicitly list com.google.firebase:firebase-core as a dependency for Firebase services to work as expected.
more info here:
https://firebase.google.com/support/release-notes/android

Related

Android firebase failed build.gradle implementation

I'm in the final stages putting my project on cloud firebase. Added all required firebase requirements using the firebase console. The Android compile fails with the error: Could not find com.google.firebase:firebase-appcheck-playintegrity:.
This is a copy of the implementation in the build.gradle file:
implementation 'com.google.firebase:firebase-appcheck-playintegrity'
Is this the correct statement for these dependencies? I assume there is no version number. This project is my first attempt putting a project on the cloud firebase. Appreciate any help.
Roger
As per the documentation:
https://firebase.google.com/docs/app-check/android/play-integrity-provider?authuser=0#install-sdk
You don’t need to specify version only if you also defined BoM dependency. Otherwise version is required.
dependencies {
// Declare the dependency for the App Check library
// When NOT using the BoM, you must specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-appcheck-playintegrity:16.0.0'
}

IllegalArgumentException when update firebase library

My Android app work fine before I update firebase libs. After updating to the newest firebase lib I got following Exception:
E/AndroidRuntime: FATAL EXCEPTION: Thread-4
Process: com.sound.booster.extra.volume, PID: 24298
java.lang.IllegalArgumentException: Please set your project ID. A valid Firebase project ID is required to communicate with Firebase server APIs: It identifies your project with Google.
at com.google.android.gms.common.internal.Preconditions.checkNotEmpty(Unknown Source:8)
at com.google.firebase.iid.FirebaseInstanceId.zza(com.google.firebase:firebase-iid##20.1.7:52)
at com.google.firebase.iid.FirebaseInstanceId.getInstance(com.google.firebase:firebase-iid##20.1.7:2)
at com.google.firebase.iid.FirebaseInstanceId.getInstance(com.google.firebase:firebase-iid##20.1.7:1)
Src before update libs:
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.firebase:firebase-config:19.1.0'
implementation 'com.google.firebase:firebase-core:17.2.2'
implementation 'com.google.firebase:firebase-analytics:17.2.2'
Src after update libs:
implementation 'com.google.firebase:firebase-messaging:20.1.7'
implementation 'com.google.firebase:firebase-config:19.1.4'
implementation 'com.google.firebase:firebase-core:17.4.1'
implementation 'com.google.firebase:firebase-analytics:17.4.1'
Could anyone explain why and how to fix this issue?
Newer versions of the Firebase SDKs depends on a service called Firebase Installations Service, which adds some extra requirements on the configuration data about the Firebase project that you include in your application. In your case it seems that you're missing a project ID in this configuration.
If you configure the Firebase project for your app by including a google-services.json in your app, the solution is typically to get the latest version of that file from the Firebase console and update in your app.
If you configure the Firebase project for your app explicitly in code, you will need to make sure that you call the setProjectId method in there.
Also see:
FirebaseInstallationsException on latest version
Firebase cannot communicate with Firebase Server
the release notes of the SDK version where this new dependency was introduced

Firebase Warning to use firebase-core library when using firebase-messaging library

I am using firebase:firebase-messaging library for push notification. While building the application I am seeing a warning which says
Warning: The app Gradle file must have a dependency on com.google.firebase:firebase-core for Firebase services to work as intended.
Release notes by firebase say
https://developers.google.com/android/guides/releases#may_23_2018
Firebase now requires the app Gradle file to explicitly list com.google.firebase:firebase-core as a dependency for Firebase services to work as expected.
Firebase-core library is used for analytics, what will happen if I don't include this library? I am already using gms:play-services-analytics.
Also, I have found the library version for both gms:play-services-analytics must be the same as firebase:firebase-core library to avoid any build error.
Something like below
implementation 'com.google.android.gms:play-services-analytics:16.0.4'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
Will there be any impact on the application if I will include firebase:firebase-core library in application gradle along with gms:play-services-analytics?
Why firebase is showing the above warning ?
What will be impacted if I don't include firebase-core with firebase-messaging library? A warning can be ignored?
Is this due to firebase adding analytics for all its features?
Here: https://support.google.com/firebase/answer/6383877?hl=en
If you don't include com.google.firebase:firebase-core, then you won't be able to use the other firebase services like firebase-database or firebase-messaging.
If you are using google-service version 3.2.1+, then you can use different library versions for gms:play-services-analytics and firebase:firebase-core.

Version Conflict while using default Google recommendations

I am trying to use several functionalities of Firebase at the same time, which requires several implementations. Namely, cloud storage, database, and authentication. However, when using the Firebase interface in android studio and clicking on "add *** to your app" to add the implementation I'm getting the conflict
"Please fix the version conflict either by updating the version of the google-services"
implementation 'com.github.bumptech.glide:glide:4.0.0'
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
Those are the ones im using ( there is a red line under the auth one and when I hover over it, it says all libraries must use the same Version ...
Any ideas how to solve this ?
change this:
implementation 'com.google.firebase:firebase-auth:11.6.0'
into this:
implementation 'com.google.firebase:firebase-auth:11.8.0'
Ok After some Trial and Errors, I found out that I have to use 11.6.0 on all of them since Auth 11.8.0 Does not exist yet.

Fix the version conflict either by updating the version of the google-services plugin or updating the version of com.google.android.gms to 11.8.0 [duplicate]

This question already has an answer here:
How to add firebase-admin to my android project?
(1 answer)
Closed 5 years ago.
I'm developing an Android app using Firebase, and went to install the Admin SDK using this tutorial. In my build.gradle file in my app, I've had a couple of dependencies that have given me warnings since I added them earlier in the project, but I was still able to run the application. Once I added the dependency needed for Admin SDK, things got a little more serious...
These are the original dependencies and their warnings:
implementation 'com.google.firebase:firebase-core:11.8.0'
All gms/firebase libraries must be the exact same version specification. Found versions 9.6.0, 11.8.0
implementation 'com.android.support:appcompat-v7:26.1.0'
All com.android.support libraries must be the exact same version specification. Found versions 26.1.0, 23.4.0
I searched the whole project using the double-shift search function in Android Studio and couldn't find anything that used either of the conflicting versions mentioned (9.6.0 or 23.4.0).
Like I said, the app still ran so I carried on developing. While adding the Firebase Admin SDK, I added the following dependency to my build.gradle:
implementation 'com.google.firebase:firebase-admin:5.6.0'
When I hit 'sync' on my gradle, I got the following error:
Error:Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.8.0.
This has left me a bit confused as I believe the most recent version of com.google.firebase:firebase-admin to be 5.6.0, so I don't see how I can be getting a version conflict for using this.
My app won't run while this error exists, so any help getting past it would be very much appreciated. I'm new to Android development so it might well be something very obvious that I've missed.
Here is my full list of dependencies:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0' <-- warning
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-core:11.8.0' <-- warning
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.firebaseui:firebase-ui:0.6.0'
implementation 'com.firebaseui:firebase-ui-auth:3.1.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-admin:5.6.0' <-- introduced error
implementation 'com.google.firebase:firebase-messaging:11.8.0'
}
If I can include anything else that will help with diagnosing, please let me know!
Thanks in advance,
Mark
The Firebase admin SDK is meant for JVM servers and can't be used in tandem with client SDKs. See this great post for more details. I would recommend using Cloud Functions for admin stuff instead since they're something you control and can't be compromised on the client.

Categories

Resources