I have an Android app with two Build Types. One is Debug
and the other one is Release
the issue I am facing is that my Debug Build
is sending crash reports to Crashlytics and my Release Build
is not sending any crash reports to the Crashlytics console and shows the loading icon as shown in the Screenshot.
The difference in both the variants is that one has Proguard enabled and other one doesn't.
Build Types in build.gradle(:app)
look like this:
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
}
}
}
I have followed the complete for setting up the crashlytics mentioned here: Firebase Crashlytics Guide
Here is the checklist
- Enabled Crashlytics From Console
- Added the Crashlytics Gradle plugin as a buildscript dependency in project level
build.gradle
with version:2.3.0- Applied gradle plugin in
build.gradle(:app)
- Initilized Crashlytics
Well, Found out that the issue is related to this flag here:
firebaseCrashlytics {
mappingFileUploadEnabled false
}
In the case of Debug
build Proguard is not enabled so the mapping file is not created as well so there is no need to upload the mappings file.
But in the case of Release
build, I have enabled the proguard
So, technically I need to enable the mappings file to be uploaded so that crashlytics reports can be sent to the console and properly reported.
Changing the above code in Release
to this fixed the issue.
firebaseCrashlytics {
mappingFileUploadEnabled true
}
Got clue from the documentation here
After Fixing that issue I came across another issue while creating the signed apk The Host name may not be empty
and you can follow this for the fix.
Cheers :)