[英]Firebase Crash report not appearing in android after Firebase crashlytics update
I am not able to view the Crash Report, after update Firebase crashlytics dependency in Android. Even my Firebase console shows, "You have the latest SDK installed".在 Android 中更新 Firebase crashlytics 依赖项后,我无法查看崩溃报告。甚至我的 Firebase 控制台也显示“您安装了最新的 SDK”。 kindly refer my build details.
请参考我的构建细节。
build.gradle build.gradle
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath 'com.google.gms:google-services:4.3.4'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
}
}
allprojects {
repositories {
google()
mavenLocal()
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(:app) build.gradle(:应用程序)
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics'
android {
lintOptions {
checkReleaseBuilds false
abortOnError false
}
compileSdkVersion 28
defaultConfig {
applicationId "com.XXX.XXX"
minSdkVersion 16
targetSdkVersion 28
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
renderscriptSupportModeEnabled true
multiDexEnabled true
}
buildTypes {
release {
// signingConfig signingConfigs.release
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// resValue "string", "app_name", "$app_name_release"
}
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
buildConfigField "String", "TYPE", '"DEBUG"'
}
}
flavorDimensions "mode", "key"
productFlavors {
lite {
dimension "mode"
applicationId "com.xxx.xxx"
versionCode 23
versionName "4.4.3"
manifestPlaceholders = [app_name: "Pro-Inspector"]
}
pi {
dimension "mode"
applicationId "com.xxx.xxx"
versionCode 53
versionName "4.4.3"
manifestPlaceholders = [app_name: "Pro-Inspector"]
}
local {
dimension "key"
}
sandbox {
dimension "key"
}
demo {
dimension "key"
}
dev {
dimension "key"
}
production {
dimension "key"
}
live {
dimension "key"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
variantFilter { variant ->
def modeName = variant.flavors*.name
def keyName = variant.flavors*.name
// To check for a certain build type, use variant.buildType.name == "<buildType>"
// Gradle ignores any variants that satisfy the conditions below
if (modeName.contains("lnt") && keyName.contains("demo")) {
setIgnore(true)
}
if (modeName.contains("pi") && keyName.contains("dev")) {
setIgnore(true)
}
if (modeName.contains("pi") && keyName.contains("production")) {
setIgnore(true)
}
if (modeName.contains("lnt") && keyName.contains("live")) {
setIgnore(true)
}
}
}
dependencies {
implementation 'com.google.firebase:firebase-crashlytics:17.2.2'
implementation 'com.google.firebase:firebase-analytics:18.0.0'
implementation 'com.google.firebase:firebase-core:18.0.0'
implementation 'com.google.firebase:firebase-messaging:21.0.0'
implementation 'com.google.firebase:firebase-auth:20.0.0'
implementation 'com.google.firebase:firebase-messaging-directboot:21.0.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// RETROFIT
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
// GLIDE
implementation 'com.github.bumptech.glide:glide:4.3.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'
// VIEWMODEL
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.0.0'
api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.material:material:1.1.0-alpha02'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.daasuu:EasingInterpolator:1.0.0'
implementation 'com.google.android.gms:play-services-vision:20.1.2'
implementation 'com.google.android.gms:play-services-location:17.1.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-identity:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.1.0'
implementation 'com.google.android.gms:play-services-places:17.0.0'
implementation 'org.adw.library:discrete-seekbar:1.0.1'
implementation 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'androidx.multidex:multidex:2.0.1'
androidTestImplementation 'androidx.multidex:multidex:2.0.1'
androidTestImplementation 'androidx.multidex:multidex-instrumentation:2.0.0'
implementation 'commons-io:commons-io:2.0.1'
testImplementation 'junit:junit:4.12'
implementation project(':pdfviewer')
//retrofit dependencies
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.2.0'
}
apply plugin: 'com.google.gms.google-services'
Anybody faced this issue already?有人已经遇到过这个问题吗? Can anyone please help me to view crashes in console
谁能帮我查看控制台中的崩溃
I also faced the same issue and to solve this I did the following steps.我也遇到了同样的问题,为了解决这个问题,我做了以下步骤。
After new Crashlytics SDK were added.添加新的 Crashlytics SDK 之后。 Download the new Google-services.json file from the Firebase console (you can get it from Project Settings in Firebase console)
从 Firebase 控制台下载新的 Google-services.json 文件(您可以从 Firebase 控制台的项目设置中获取)
Force a crash for first time.第一次强制崩溃。
throw new RuntimeException("Test Crash");
Run your app.It will crash because we were added above Runtime exception.运行你的应用程序。它会崩溃,因为我们在运行时异常上面添加了。
Now check on your Firebase console.现在检查您的 Firebase 控制台。 You can see the crash report
你可以看到崩溃报告
In my case, I made the silly mistake of doing:就我而言,我犯了一个愚蠢的错误:
FirebaseCrashlytics.getInstance().setUserId(uid);
where uid
was still null.其中
uid
仍然是 null。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.