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

[Question] Is there any specific reason why R8/Minify is disabled in release builds? #79

Closed
starry-shivam opened this issue May 17, 2024 · 4 comments
Assignees

Comments

@starry-shivam
Copy link
Contributor

starry-shivam commented May 17, 2024

Hi, I've been using a self-compiled build of this app for some time (until a new release is published), and I noticed that R8 was disabled in the release builds. So, I recently enabled it and built it again with minify mode. All I had to do was add some rules related to EventBus to prevent one crash when onResume() is called, as R8 strips/obfuscates the subscriber methods for some reason. Other than that, it's been working fine. I've also added a rule to preserve model classes just to be safe, as R8 sometimes causes problems with them, although it was working fine even without it (at least for Imgur URLs).

I wanted to ask if there are any other reasons you decided not to enable R8 in your release builds. One clear benefit of having R8 on is a much-optimized APK size. For example, R8-enabled builds usually have 50 to 70% reduced APK size as they don't contain many unused/unreferenced parts of the dependencies used by the app.

If you don't mind, can I create a PR with these changes?

@SpartanJ
Copy link
Owner

I wanted to ask if there are any other reasons you decided not to enable R8 in your release builds.

Depends, laziness is a good reason? 😆 I skipped the minification exactly because of the issues you mentioned, it's no always easy to know what's going to fail, so better safe than sorry.

One clear benefit of having R8 on is a much-optimized APK size. For example, R8-enabled builds have a 50% reduced APK size as they don't contain many unused/unreferenced parts of the dependencies used by the app.

Yes, I know, but we are talking about an 8MB application, so I honestly did not care at all.

If you don't mind, can I create a PR with these changes?

Sure! If someone already took the time we should enjoy the benefits. 😄

Thanks!

@starry-shivam
Copy link
Contributor Author

Closing as completed, thanks :)

@SpartanJ
Copy link
Owner

Thanks, I'll try to prepare a new release this weekend, I forgot about it the last one.

@starry-shivam
Copy link
Contributor Author

Thanks, I'll try to prepare a new release this weekend, I forgot about it the last one.

Great 👌

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