在Android上的Instant App上使用Firebase

Dar*_*ali 7 android firebase-authentication firebase-realtime-database firebase-storage android-instant-apps

我正在迁移App以支持Instant App.

所以,我将我的项目结构模块化如下

我的项目结构

但是当我添加Firebase时,只有firebase Analytics可以使用它.像另一个特点火力地堡验证,存储,公司的FireStore数据库没有工作在这里.

我有一个错误:

Firebase App Not Initialized.
Although I have declared FirebaseApp.Initialize(this) through Activity 
or Application class.
Run Code Online (Sandbox Code Playgroud)

但Firebase Analytic可以正常工作.

这是我在活动中的代码

在这里,我的Gradle

如果有人知道如何解决这个问题,请帮忙.

Ara*_*cem 2

正如您在此错误报告中看到的,文档和/或谷歌服务插件存在问题。要解决此问题,您必须在每个模块和 build.gradle 文件中添加google-service.jsonapply plugin: 'com.google.gms.google-services代码。