- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我们关注了Add Firebase to your Android Project但我们在 Firebase 控制台中看不到应用接收数据。
当我们启动应用程序时,日志显示:
FirebaseInitProvider: FirebaseApp initialization unsuccessful
这是什么意思?我们做错了什么?
我在文档中找不到此错误,在 StackOverflow 中也找不到。
最佳答案
What does this mean? What are we doing wrong?
假设身份验证没有成功。
a) project 级别的 buildscript
repositories
和 dependencies
build.gradle
:
buildscript {
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) module 级别 app/build.gradle
的 dependencies
(Android Intel x86 镜像可能仍具有以前版本的安装的 Google Play 服务,例如 10.2.0
在当前的 x86
模拟器上运行,而例如 11.8.0
在我的物理上运行 ARM
设备)。引用 play-services
和 firebase-core
将包含它们的 all 模块,除非将它们排除在外。 更新:现在必须单独引用所有库。引用 com.google.android.gms:play-services
和 com.google.firebase:firebase-core
不再起作用,因为 15.0.0
.
android {
...
buildTypes {
debug {
// suffixing the package name for debug builds,
// in order to partially mute the crash-reporting
// is an *optional* configuration (see below):
applicationIdSuffix ".debug"
}
}
}
dependencies {
// Google Play Services
// https://developers.google.com/android/guides/releases
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.android.gms:play-services-auth:16.0.0"
implementation "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-config: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-messaging:17.3.0"
implementation "com.google.firebase:firebase-appindexing:16.0.1"
implementation "com.google.firebase:firebase-functions:16.1.0"
implementation "com.google.firebase:firebase-invites:16.0.1"
// implementation "com.google.firebase:firebase-crash:16.0.1"
implementation "com.google.firebase:firebase-ads:15.0.1"
implementation "com.google.firebase:firebase-firestore:17.0.4"
implementation "com.google.firebase:firebase-perf:16.0.0"
// the inapp messaging may cause dependency conflicts:
// implementation "com.google.firebase:firebase-inappmessaging:17.0.0"
// implementation "com.google.firebase:firebase-inappmessaging-display:17.0.0"
}
c) mobile/build.gradle
的底线应该是:
// apply the Google Services Plugin
apply plugin: "com.google.gms.google-services"
d) 确保在 app/google-services.json
中提供(下载的)凭据;在 Firebase 控制台上,必须添加 both SHA1(或 SHA256)散列,调试 和 发布 key ,以使两个版本都能正确进行身份验证;一旦全部匹配,它应该报告:
I/FirebaseInitProvider: FirebaseApp initialization successful
这一切都有很好的记录,请参阅 Setup Google Play Services , Firebase Quickstart或 Crash Reporting ;虽然我发现 Firebase 博客上的这篇文章非常有用:Organizing your Firebase-enabled Android app builds ,因为它解释了如何部分静音崩溃报告。 release notes始终宣布更新和更改。
关于android - FirebaseInitProvider : FirebaseApp initialization unsuccessful,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37321728/
我正在创建一个 Android 应用程序,目前正在尝试使用 Firebase 实现用户身份验证。据我所知,我的应用已连接到我的 Firebase 服务器。 我在尝试通过按下按钮从 SignIn Act
默认 FirebaseApp 在此过程中未初始化。确保首先调用 FirebaseApp.initializeApp(Context)。 我尝试了很多方法,但无法在设备中获取通知。 我也尝试过下面的事情
在更改了一些 gradle 依赖项后,我今天遇到了这个 fatal error 。即使我试图将 gradle 依赖恢复到原来的状态,我仍然在这一行收到错误: class MainActivity :
我正在尝试使用 Firebase 存储下载图像。我写了下面的代码 主 Activity .java public class MainActivity extends AppCompatActivit
我正在使用 kotlin 制作 Firebase 身份验证注册页面,但在我运行该应用程序时出现运行时错误。请看第 3 行和第 14 行我不知道是什么问题。 我没有附上主要代码,如果需要附上代码,请通知
我正在开发一个包含鸟类学应用程序的应用程序,并且我使用 Firabase 作为 BBDD。 我的问题是我收到以下错误:'java.lang.IllegalStateException:默认 Fireb
在我的 android 应用程序中,编译应用程序时出错。我在最新的 android studio 中工作,并使用 Firebase UI Auth 和 Firebase Database,所有版本在
在我将带有 fabric 集成的应用程序更改为 firebase Crashlytics 后,该应用程序开始在 HMS 设备上崩溃并给出如下错误。我在使用 Google Play 设备时没有遇到任何问
我尝试使用 Firebase 进行分析,但当我在 AppDelegate 的 didFinishLaunchingWithOptions 中添加 FirebaseApp.configure() 时。
尝试使用适用于 Android 的 firebase 库,遵循 firebase 文档中的所有步骤,当我应用说明时在 logcat 中显示我 FirebaseApp initialization un
03-02 21:03:03.087 6253-6253/ D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Sk
我的项目突然停止正常运行 - 它无法初始化 FirebaseApp。 我一直在使用老式的 Firebase 配置 - 直接来自 Firebase 控制台的 Google-Services 文件。我切换
我正在尝试删除 secondaryApp 代码,因为我想阻止函数 firebaseAuth.createUserWithEmailAndPassword(email,password) 在用户创建后自
我正在开发一个 iOS 项目,该项目使用 Firebase 进行分析、crashlytics 和远程配置获取。对于依赖管理,我使用 cocoapods 并且项目中的 Firebase 的当前版本是最新
我正在我的 macOS Catalina 10.15.6 上使用 Xcode 创建一个社交应用程序(出于个人兴趣),并且在真正做某事之前面临大量配置问题。 我已经陷入这个 swift 编译器错误 2
文档暗示,如果配置的任何部分失败,它都会引发异常,但似乎不可能实际捕获异常(Swift 4)。当然,不能将语句包装在 do..catch block 中。如果失败,我的应用是否注定会崩溃或继续尝试(但
我看到一些异常消息 Default FirebaseApp is not initialized in this process com.armoured。确保先调用 FirebaseApp.init
我正在尝试从 gcm 切换到 fcm。我已按照 gcm 到 fcm 迁移指南中详述的步骤进行操作,尽管 FirebaseApp 没有初始化。 我已经确定了几个可能的问题,但是 codenameone
我正在尝试使用 Robolectric 运行测试,它与 Firebase 集成。我有一个项目 MyProject - Test,我将使用它在数据库的真实实例中运行测试。 问题是,在测试前运行清理时,出
我想在我的 Android 应用程序中实现 Firebase-Messaging 插件。我从 github 中的“quickstart-android-master/messaging”示例开始:ht
我是一名优秀的程序员,十分优秀!