gpt4 book ai didi

android - 应用程序启动时 Firebase Crashlytics 崩溃

转载 作者:行者123 更新时间:2023-12-05 00:04:25 25 4
gpt4 key购买 nike

我遇到了一个非常奇怪的问题,当我尝试打开应用程序时出现崩溃:

2020-08-14 08:23:42.577 27533-27533/? E/FirebaseCrashlytics: The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.
2020-08-14 08:23:42.577 27533-27533/? E/FirebaseCrashlytics: .
2020-08-14 08:23:42.577 27533-27533/? E/FirebaseCrashlytics: . /\
2020-08-14 08:23:42.577 27533-27533/? E/FirebaseCrashlytics: . / \
2020-08-14 08:23:42.577 27533-27533/? E/FirebaseCrashlytics: . / \
2020-08-14 08:23:42.577 27533-27533/? E/FirebaseCrashlytics: . / | | \
2020-08-14 08:23:42.577 27533-27533/? E/FirebaseCrashlytics: . | |
2020-08-14 08:23:42.577 27533-27533/? E/FirebaseCrashlytics: . | |
2020-08-14 08:23:42.577 27533-27533/? E/FirebaseCrashlytics: .
2020-08-14 08:23:42.580 27533-27533/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ahlibank.ahlipay.subscriber.dev, PID: 27533
java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.
at android.app.ActivityThread.installProvider(ActivityThread.java:6396)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IllegalStateException: The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.
at com.google.firebase.crashlytics.internal.common.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:122)
at com.google.firebase.crashlytics.FirebaseCrashlytics.init(FirebaseCrashlytics.java:165)
at com.google.firebase.crashlytics.CrashlyticsRegistrar.buildCrashlytics(CrashlyticsRegistrar.java:55)
at com.google.firebase.crashlytics.CrashlyticsRegistrar.access$lambda$0(Unknown Source:0)
at com.google.firebase.crashlytics.CrashlyticsRegistrar$$Lambda$1.create(Unknown Source:2)
at com.google.firebase.components.ComponentRuntime.lambda$new$0(com.google.firebase:firebase-components@@16.0.0:69)
at com.google.firebase.components.ComponentRuntime$$Lambda$1.get(Unknown Source:4)
at com.google.firebase.components.Lazy.get(com.google.firebase:firebase-components@@16.0.0:53)
at com.google.firebase.components.ComponentRuntime.initializeEagerComponents(com.google.firebase:firebase-components@@16.0.0:158)
at com.google.firebase.FirebaseApp.initializeAllApis(com.google.firebase:firebase-common@@19.3.0:563)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.3.0:304)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.3.0:268)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.3.0:253)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@19.3.0:51)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1917)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1892)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@19.3.0:45)
at android.app.ActivityThread.installProvider(ActivityThread.java:6391)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853) 
at android.app.ActivityThread.access$1100(ActivityThread.java:199) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6669) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 

没有解决问题的线索。我的应用程序文件夹中确实有 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'

希望对您有所帮助。

关于android - 应用程序启动时 Firebase Crashlytics 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63405876/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com