The Android Gradle Plugin allows each application variant to have it's own versionCode and versionName, while Bugsnag also allows versionCode overriding using an AndroidManifest.xml meta-data attribute (com.bugsnag.android.VERSION_CODE). Using these two attributes together causes unexpected behaviour, with the source-maps being uploaded with one version and reports generated with a different version.
When detecting both a versionCodeOverride and com.bugsnag.android.VERSION_CODE in the same project we will now emit an error explaining that they should not be used together.
Design
The default versionCode / versionName attributes are tracked separately to those provided in meta-data attributes, and the final version details for a variant output are determined by a new AndroidManifestInfo.forApkVariantOutput function. This logic has been lifted into the BugsnagPlugin and the tasks requiring the version details receive their final AndroidManifestInfo by way of a mapped Provider.
Goal
The Android Gradle Plugin allows each application variant to have it's own
versionCode
andversionName
, while Bugsnag also allowsversionCode
overriding using anAndroidManifest.xml
meta-data attribute (com.bugsnag.android.VERSION_CODE
). Using these two attributes together causes unexpected behaviour, with the source-maps being uploaded with one version and reports generated with a different version.When detecting both a
versionCodeOverride
andcom.bugsnag.android.VERSION_CODE
in the same project we will now emit an error explaining that they should not be used together.Design
The default
versionCode
/versionName
attributes are tracked separately to those provided inmeta-data
attributes, and the final version details for a variant output are determined by a newAndroidManifestInfo.forApkVariantOutput
function. This logic has been lifted into theBugsnagPlugin
and the tasks requiring the version details receive their finalAndroidManifestInfo
by way of a mappedProvider
.Testing
New unit tests and end-to-end tests.