Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload JVM Mapping not working with Proguard 7 plugin on Android #463

Open
peterdk opened this issue May 18, 2022 · 4 comments
Open

Upload JVM Mapping not working with Proguard 7 plugin on Android #463

peterdk opened this issue May 18, 2022 · 4 comments
Labels
backlog We hope to fix this feature/bug in the future bug Confirmed bug

Comments

@peterdk
Copy link

peterdk commented May 18, 2022

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:

 bugsnag {
                uploadJvmMappings = true
                uploadNdkMappings = true
                overwrite = true
                sharedObjectPaths = [new File("../debugSOs/obj")]

            }

Am I missing something here? Can I use a workaround?

@peterdk
Copy link
Author

peterdk commented May 18, 2022

It seems that this line in the gradle plugin causes the issue:

private fun Project.isJvmMinificationEnabled(variant: BaseVariant) =
        variant.buildType.isMinifyEnabled || hasDexguardPlugin()

@luke-belton
Copy link
Member

Hi @peterdk - we're aware of some issues with the latest version of the Android Gradle Plugin, e.g. #462. Could you let us know what versions you're using of the following please?

  • Android Studio
  • Gradle
  • Android Gradle Plugin (AGP)
  • Bugsnag Android Gradle Plugin

@luke-belton luke-belton added the awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. label May 18, 2022
@peterdk
Copy link
Author

peterdk commented May 19, 2022

  • Android Studio Chipmunk 2021.2.1
  • Gradle 7.4.2
  • Android Gradle Plugin 7.2.0 (als tested with 7.1.3 same issue)
  • Bugsnag gradle 7.2.0 (also tested with 7.1.0 same issue)

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.

@abigailbramble abigailbramble removed the awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. label May 20, 2022
@johnkiely1
Copy link
Member

johnkiely1 commented May 26, 2022

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

@johnkiely1 johnkiely1 added bug Confirmed bug backlog We hope to fix this feature/bug in the future labels May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to fix this feature/bug in the future bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

4 participants