I would like to set up crashlytics for debug and release mode but I can't find proper informations in firebase docs.
At now the app is in one project and there is only one crashlytics for debug and release. I can't create another app with the same package as a previous one. Another option is to have another project with the same package as the first one but I need to have one project due to api keys and other functionalities.
I have some two ideas but without a solution:
Does anyone have some some tips which could help to solve this case?
Both options are possible. However the first one would result in two separate Firebase projects, which is less managable. It's better to stick with one Firebase project and with the same app.
In short:
The package identifier should be different to make a difference between the debug and release variant in one project. We can distinct this by using the build type.
Next, the second identifier can be added to the Firebase project. Crashlytics will make the distinction between them in the app.
To achieve that, we can do the following.
a. Go to the project settings.
b. Add an additional Android app with the following configuration:
<app_identifier>.debug
Debug
at the endc. Register this app
d. Download the google-services.json
file, we will need it in the next step.
e. Go to the Crashlytics tab in the left menu
f. Enable Crashlytics for both the apps
Next
at the second stepa. Place the google-services.json
file in the project (under the app
folder) -> Overwrite the old one
b. Open the app/build.gradle
file.
android
block, the buildTypes
will be shown.debug
build type, add applicationIdSuffix '.debug'
(add the debug type if it doesn't exist in the file).debug
after the actual package identifier for the debug build.c. Result, it should look like this:
android {
// ...
buildTypes {
debug {
applicationIdSuffix '.debug'
}
release {
// ...
}
}
}
Make a crash and it will result in the corresponding app in Firebase Crashlytics. There is a dropdown with both the projects at the top-left of the page.
Now, Crashlytics will automatically use the right Firebase app when sending a crash report. This works, since the google-services.json
actually contains the configuration for both the build types. Crashlytics will use the right one based on the package identifier.
Last note: Don't forget enable Crashlytics at the Crashlytics tab in the Firebase Console (as described in step 1f)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With