如何解决Firebase Crashlytics在应用启动时崩溃
我面临一个非常奇怪的问题,当我尝试打开应用程序时遇到此崩溃:
{{1}}
没有解决的线索。我的应用程序文件夹中确实有google.services.json
解决方法
你忽略了两件事 (1) 在您的项目级 build.gradle 文件中,添加 Crashlytics Gradle 插件作为 buildscript 依赖项。
buildscript {
repositories {
// Check that you have Google's Maven repository (if not,add it).
google()
}
dependencies {
// ...
// Check that you have the Google services Gradle plugin v4.3.2 or later
// (if not,add it).
classpath 'com.google.gms:google-services:4.3.8'
// TODO:Add the Crashlytics Gradle plugin
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
}
}
allprojects {
repositories {
// Check that you have Google's Maven repository (if not,add it).
google()
}
}
(2) 在您的应用级 build.gradle 文件中,应用 Crashlytics Gradle 插件
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services' // Google services Gradle plugin
// TODO:Apply the Crashlytics Gradle plugin
apply plugin: 'com.google.firebase.crashlytics'
希望对你有帮助。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。