Supporting multiple app variants

If you want to use different Hansel App Id for different build types or flavors, you'll have to update the module's build.gradle file for it. One of the advantages of having different Hansel App Ids is to ensure that crashes from the debug build are reported under one app name and the ones reported from production build are reported under a different app on the Hansel Dashboard.

For example if you want to have different Hansel App Id for debug and release build types, you can update your configuration to look like the one below:

buildTypes{
    debug{
        resValue 'string', "hansel_app_id", "<DEBUG_APP_ID>"
        resValue 'string', "hansel_app_key", "<DEBUG_APP_KEY>"
    }
    release{
        resValue 'string', "hansel_app_id", "<RELEASE_APP_ID>"
        resValue 'string', "hansel_app_key", "<RELEASE_APP_KEY>"
    }
}

If you want to have different Hansel App Id for different flavors, you can update your configuration to look like the one below:

productFlavors {
stage {
resValue 'string', "hansel_app_id", "<STAGE_APP_ID>"
resValue 'string', "hansel_app_key", "<STAGE_APP_KEY>"
}
prod {
resValue 'string', "hansel_app_id", "<PROD_APP_ID>"
resValue 'string', "hansel_app_key", "<PROD_APP_KEY>"
}
}
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.