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

Error screen does not work with minifyEnabled = true #21

Closed
pandulapeter opened this issue Oct 27, 2020 · 3 comments
Closed

Error screen does not work with minifyEnabled = true #21

pandulapeter opened this issue Oct 27, 2020 · 3 comments

Comments

@pandulapeter
Copy link

Hi,

Great idea with the library! Unfortunately I cannot make it work on minified builds: the Service simply doesn't get the message to start the Activity. I can reproduce the issue by building the release variant of the demo app in this repository, without modifying anything. Devices: OnePlus 3T (Android 9), Galaxy Note 10+ (Android 10)

I've spent some time trying to fix this as I'm working on something similar, but couldn't make it work. I tried starting the service in different ways (starting the Activity in onStartCommand()) which, again, works in debug builds but not after enabling minification. @Keep-ing every relevant class didn't fix the issue either.

Is there a limitation regarding ProGuard I wasn't aware of?

Thanks,
Peter

@haroldadmin
Copy link
Owner

Can you confirm if you are using minification on debug builds or on release builds? The documentation suggests adding this library as a debug dependency with debugImplementation, so it is not present in the release builds and will not work there.

If you do want to use it in release builds, you should be able to change debugImplementation to just implementation.

@pandulapeter
Copy link
Author

Thanks for the quick reply!

  1. I'm stupid, your library works perfect if I change the debugImplementation keyword to implementation.
  2. My code didn't work in minified builds because of the way I was communicating between the service and the activity - still not sure what's happening there but that isn't related to WhatTheStack.

Thanks again :)

@haroldadmin
Copy link
Owner

No problem. It looks like I can probably improve a little bit on this area in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants