FirebaseInitProvider: FirebaseApp initialization unsuccessful –

Development issue/problem:

We have been tracking Add Database in your Android project, but we don’t see the application retrieving the data from the Firebase console.
And when we launch the application, the logbook indicates

FirebaseInitProvider : FirebaseApp initialization failed

What does that mean? What are we doing wrong?
I can’t find this error in the documents or here on StackOverflow.

How can I solve this problem?

Solution 1:

What does that mean? What are we doing wrong?

We can assume the authentication was unsuccessful.

(a) Script repositories and dependencies for the build.gradle project layer:

builds script {
repositories {
google()
jcenter()
}
dependencies {

// Android Gradle Plugin
classpath com.android.tools.build: gradle: 3.3.2

// Google services plugin
classpath com.google.gms: google services: 4.2.0
}
}

b) Modular/build.gradle application dependencies (Intel x86 Android images may still have the previous version of Google Play services installed, for example 10.2.0 on the current x86 emulator and 11.8.0 on my physical ARM device). The links to the game services and the core of the firebase include all of their modules, or even exclude some of them. Update : You must now consult all libraries separately. The link to com.google.android.gms:play-services and com.google.firebase:firebase-core does not work anymore from version 15.0.0.

android {

buildTypes {
debug {
// packet name suffix for debug builds,
// for partial shutdown
// is *optionally* configured (see below):
applicationIdSuffix .debug
}
}
}.

Dependencies {

// Google Play Services
// https://developers.google.com/android/guides/releases
implement com.google.android.gms:play-services-base:15.0.1
implement com.google.android.gms:play-services-out:16.0.0
implement com.google.android.gms:play-services-identity:15.0.1

// Google Firebase
// https://firebase.google.com/support/release-notes/android
implementation com.google.firebase: firebase-core: 16.0.1
implementation com.google.firebase: firebase-auth: 16.0.3
implementation com.google.firebase:firebase configuration:16.0.0
implementation com.google.firebase:firebase storage:16.0.1
implementation com.google.firebase:firebase database:16.0.1
implementation com.google.firebase:firebase messages:17.3.0
implementation com.google.firebase:firebase-app indexing:16.0.1
implementation com.google.firebase:firebase functions:16.1.0
implementation com.google.firebase:firebase invitations:16.0.1 1
// implementation com.google.firebase: firebase-crash: 16.0.1 1
// com.google.firebase execution: firebase functions: 16.0.1 1
// com.google.firebase execution: firebase crash: 16.0.1 1
execution com.google.firebase: firebase functions: 16.0.1

// the application message may cause a dependency conflict:
// com.google.firebase: firebase-inappmessaging: 17.0.0
// com.google.firebase: firebase-inappmessaging-display: 17.0.0
}

(c) the final result of the mobile sorting installation/building is :

// Apply Plugin
Plugin: com.google.gms.google services

d) Make sure the (downloaded) data is available in app/google-services.json; the Firebase console must add the two SHA1 (or SHA256) hashes, debugging, and release keys to properly authenticate the two builds; if they all match, it must report this:

I/FirebaseInitProvider : FirebaseApp initialization was a success

All this is well documented, see configuring Google Play Services, Firebase Quick Start of Failure Reports; although I found this article from the Firebase blog very useful: Organize your Firebas-compatible Android application, as this explains how to partially disable the error message. The release notes will always notify you of updates and changes.

Solution 2:

This happens when you do not apply the plugin: com.google.gms.google services in your application/build.gradle. Try adding.

Also make sure that the Google Play services SDK is installed in the Android SDK manager.

Solution 3:

The first thing I advise you to do is to check:

1) Did you include in your manifesto?

Solution 4:

Be sure to add this line to the build.gradle file at the application level.

Application plug-in: com.google.gms.google services

Solution No 5:

I also encountered a similar problem. I imported my google-developer project into Firebase and followed all the steps described in the Android Studio application and Firebase console instructions, i.e. added dependencies, added the google-services.json file and recreated it.

No data is being sent to the Firebase console yet. When I looked at the logbook, Firebase failed to initialize because apparently the Google_app_id was missing.

After a lot of trial and error I had to add a new string resource to my res/values/strings.xml file.

YOUR_APP_ID_GOOGLE

You can find the Google App ID in the file google_services.json downloaded from the Firebase console, under mobilesdk_app_id.

Client: [
{
client_info: {
mobilesdk_app_id : SOMETHING
}
.
.
.

Copy and paste the mobilizedk_app_id into your string resource in the res/values/strings.xml file named google_app_id.

Restore the code and it should work.

Solution No 6:

The whole problem arises for two reasons:

1. They didn’t make it to Mainfest.

[fill in the image description here] [1]

2. Your version of the Gradle build has an error – depending on the project level
.

Classpath ‘com.google.gms:google-services:4.1.0’.

in place of

Classpath ‘com.google.gms:google-services:4.0.1’.

http://server.digimetriq.com/wp-content/uploads/2021/01/FirebaseInitProvider-FirebaseApp-initialization-unsuccessful.png
http://server.digimetriq.com/wp-content/uploads/2021/01/1609999207_316_FirebaseInitProvider-FirebaseApp-initialization-unsuccessful.png

Solution No 7:

In my case, I did everything right at Gradle. Despite the fact that it turned out that the initialization of FirebaseApp did not succeed.

I added the com.google.android.c2dm.permission.RECEIVE to the manifest, which solved my problem.

Solution No 8:

In my case, I have tried to selectively compile Google Play services.
Instead of

Compile com.google.android.gms:play-services:9.4.0.

as described at the following address: https://developers.google.com/android/guides/setup#ensure_devices_have_the_google_play_services_apk

I have manually added maps and some other dependencies of the Google Play service as

compiles ‘com.google.android.gms:play-services-maps:9.4.0’
compiles ‘com.google.android.gms:play-services-maps:9.4.0’.

Suddenly Firebase didn’t work after that.

As a result, I had to come back and start using

Compile com.google.android.gms:play-services:9.4.0.

instead of being selective.

Solution No 9:

I have the same log-cat exit.

Determined by updating the dependency on Google Play services to 9.0.0 in my app/build.gradle.

and update

buildScript {
//. Dependencies
{
//….
Classpath ‘com.google.gms:google-services:3.0.0’ }
}
}

in my build.gradle project on version 3.0.0.

Solution No 10:

In build.gradle (project level)

Edit

Classpath ‘com.google.gms:google-services:4.1.0’.

Sync and corrections by n17t01

Classpath ‘com.google.gms:google-services:4.0.1’.

Good luck!

Related Tags:

com.google.gms:google-services latest version,com google gms google-services 3.1 0,missing google app id value from from string resources with name google_app_id,default firebaseapp is not initialized in this process flutter,please apply google-services plugin at the bottom of the build file,classpath 'com google gms google-services:4.0 1,google_crash_reporting_api_key,default firebaseapp failed to initialize because no default options were found android

Leave a comment

Your email address will not be published. Required fields are marked *