Description
Describe the bug
We have multiple flavors in the app. We would like the production flavor to fail when bugsnag fails to upload the mappings file, but not fail for every other flavor. There is an example in https://docs.bugsnag.com/build-integrations/gradle/ to use variant filters to enable/disable the bugsnag plugin on a variant basis. This works fine, but when trying to use the failOnUploadError flag, it doesn't work as expected with the variants filters.
Expected behavior
Whenever we build any flavor that is not production, we expect the build to not fail if the bugsnag upload process fails.
Whenever we build the production flavor, we expect the build to fail if the bugsnag upload process fails
Actual behavior
Whenever we build any flavor that is not production, the upload process doesn't fail
Whenever we build the production flavor, the upload process doesn't fail
Environment
- Android Studio version: 2020.3.1
- Gradle version: 7.0.2
- Android Gradle Plugin (AGP) version: 7.0.4
- Bugsnag Android Gradle Plugin version: 5.19.1
Example code snippet
bugsnag {
retryCount = 5
requestTimeoutMs = 300000L
endpoint = "https://uploadfake.bugsnag.example.com" // configures the Upload API endpoint
releasesEndpoint = "https://bugsnag-fake-build.example.com" // configures the Build API endpoint
variantFilter { variant ->
def variantNameLowercase = variant.name.toLowerCase()
if (variantNameLowercase.contains("production")) {
failOnUploadError = true // fails build on error only for production builds
} else {
failOnUploadError = false
}
}
}