【问题标题】:Using Firebase on Instant App on Android在 Android 上的 Instant App 上使用 Firebase
【发布时间】:2018-07-20 19:34:08
【问题描述】:

我正在迁移应用以支持 Instant App

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

但是当我添加 Firebase 时,只有 firebase Analytics 可以使用它。 Firebase AuthStorage、FirestoreDatabase 等其他功能不在这里工作

我遇到了一个错误:

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

但 Firebase Analytic 可以正常工作。

如果有人知道如何解决这个问题,请提供帮助。

【问题讨论】:

标签: android firebase-realtime-database firebase-authentication firebase-storage android-instant-apps


【解决方案1】:

正如您在 bug report 上看到的那样,文档和/或 google 服务插件存在问题。 要解决它,您必须在每个模块和 build.gradle 文件中添加 google-service.jsonapply plugin: 'com.google.gms.google-services 代码。

【讨论】:

    【解决方案2】:

    我有类似的问题并通过这样做解决了:

    1. 添加apply plugin: 'com.google.gms.google-services'
    2. 添加com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
    3. 在下面添加apply plugin: 'io.fabric'apply plugin: 'com.android.application[features]'

    在每个 build.gradle 模块文件中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多