Crashlytics 控制台显示加载器、Crashlytics 已启用并正确设置但无法获取崩溃报告?

Crashlytics console shows loader, Crashlytics enabled & Setup properly but unable to get the crash reports?

我有一个具有两种构建类型的 Android 应用程序。一个是 Debug,另一个是 Release 我面临的 问题 是我的 Debug Build 正在向 Crashlytics 发送崩溃报告,而我的 Release Build 未向 Crashlytics 控制台发送任何崩溃报告,并显示加载图标,如屏幕截图所示。

两种变体的区别在于,一种启用了 Proguard,而另一种则没有。

build.gradle(:app) 中的构建类型如下所示:

buildTypes {
        debug {
            debuggable true
            firebaseCrashlytics {
                mappingFileUploadEnabled false
            }
        }
        release {
            debuggable false
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig getSigningConfig()
            firebaseCrashlytics {
                mappingFileUploadEnabled false
            }
        }

    }

我已经完成了这里提到的 crashlytics 的设置:Firebase Crashlytics Guide

这是清单

  1. Enabled Crashlytics From Console
  2. Added the Crashlytics Gradle plugin as a buildscript dependency in project level build.gradle with version:2.3.0
  3. Applied gradle plugin in build.gradle(:app)
  4. Initilized Crashlytics

嗯,发现这个问题与这里的这个标志有关:

firebaseCrashlytics {
  mappingFileUploadEnabled false
}

Debug 的情况下,构建 Proguard 未启用,因此也未创建映射文件,因此无需上传 mappings 文件。

但在 Release 构建的情况下,我启用了 proguard 因此,从技术上讲,我需要启用要上传的映射文件,以便可以将 crashlytics 报告发送到控制台,并且正确报告。

Release 中的上述代码更改为此解决了问题。

firebaseCrashlytics {
  mappingFileUploadEnabled true
}

Got clue from the documentation here

解决该问题后,我在创建已签名的 apk The Host name may not be empty 时遇到了另一个问题,您可以 follow this for the fix.

干杯:)