Open peterdk opened 2 years ago
It seems that this line in the gradle plugin causes the issue:
private fun Project.isJvmMinificationEnabled(variant: BaseVariant) =
variant.buildType.isMinifyEnabled || hasDexguardPlugin()
Hi @peterdk - we're aware of some issues with the latest version of the Android Gradle Plugin, e.g. https://github.com/bugsnag/bugsnag-android-gradle-plugin/issues/462. Could you let us know what versions you're using of the following please?
To give some more context:
Proguard is the default implementation for minify in Android, but since Android Gradle 7 or so it now defaults to r8, and no longer can use proguard itself out of the box. Since I need proguard optimization for app performance (tests with r8 lead to less performant app) I added the proguard 'com.guardsquare:proguard-gradle:7.x
plugin, which allows for using proguard with the newer AGP.
However, this plugin requires minify
to be false, since r8 needs to be disabled. Result is that bugsnag does not see that isJvmMinificationEnabled
is true
, since the logic doesn't know anything about this proguard plugin and sees minify
set to false
.
It would be useful if bugsnag detects proguard and enabled the jvm upload, just like it also detects dexguard case. And in the case of proguard it's probably much easier to detect.
Hi @peterdk ,
Thanks for raising this. It does look like a use case we don't currently support for automatic uploads. We are going to look to get this fixed as soon as we can.
In the meantime as a work around you could look to manually upload the mapping.txt files which the Proguard plugin would generate with each build: https://docs.bugsnag.com/api/android-mapping-upload/#for-proguard
I am testing out the 7.x variant of Bugsnag for use with the new Android Gradle plugin. I get everything to work, except for uploading JVM mappings in combination with Proguard 7 Gradle plugin. Somehow it doesn't detect that mappings are available. I think it's because the new Proguard needs 'minifyEnabled' set to false.
I also tried uploading a mapping manually, but it says:
'uploadBugsnagReleaseMapping' not found in project ':project'. Some candidates are: 'uploadBugsnagNdkReleaseMapping'.
My config:
Am I missing something here? Can I use a workaround?