Darari Nur Amali
Darari Nur Amali

Reputation: 465

Using Firebase on Instant App on Android

I'm working in migrating App to support Instant App.

So, I have modularized my project structure as follow

My Project Structure

But when I'm adding Firebase, only firebase Analytics can works with it. Another feature like Firebase Auth, Storage, Firestore, And Database are not working in here.

I Got an Error :

Firebase App Not Initialized.
Although I have declared FirebaseApp.Initialize(this) through Activity 
or Application class.

But Firebase Analytic can works just fine.

Here my Code in an Activity

Here my Gradle

Please help if anyone know how to solve this.

Upvotes: 7

Views: 1029

Answers (2)

Arie Agung
Arie Agung

Reputation: 108

I have similar problem and solved by doing this:

  1. Add apply plugin: 'com.google.gms.google-services'
  2. Add com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
  3. Add apply plugin: 'io.fabric' bellow apply plugin: 'com.android.application[features]'

In every build.gradle module file

Upvotes: 0

Aracem
Aracem

Reputation: 7207

As you can see on this bug report there is a problem on the documentation and/or on the google service plugin. To resolve it you have to add the google-service.json and the apply plugin: 'com.google.gms.google-services code in every module and build.gradle file.

Upvotes: 2

Related Questions