Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 619
Darari Nur Amali Avatar asked Feb 10 '18 00:02

Darari Nur Amali


1 Answers

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.

like image 162
Aracem Avatar answered Oct 07 '22 12:10

Aracem