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

Two drawables are being put in the release APKs #857

Closed
rocboronat opened this issue May 17, 2020 · 7 comments
Closed

Two drawables are being put in the release APKs #857

rocboronat opened this issue May 17, 2020 · 7 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rocboronat
Copy link

Issue Basics

  • ObjectBox version (are using the latest version?): 2.5.1, the latest one
  • Reproducibility: always

Reproducing the bug

Description

Using ObjectBox adds two drawables to the final APK, objectbox_notification and objectbox_stop. They shouldn't be there. I don't expect the library to launch notifications. And in case it did, I prefer it to use the apps icon, not something the user doesn't know about.

Thanks about ObjectBox, of course! :)

@greenrobot-team
Copy link
Member

greenrobot-team commented May 18, 2020

Thanks for reporting.

The notification is used by the data browser.

  • We should move it from objectox-android to objectbox-android-objectbrowser, incl. AndroidObjectBrowser code (just keep a shell so release builds work).
    https://docs.objectbox.io/data-browser

@rocboronat For an immediate solution: If you include objectbox-android and don't create AndroidObjectBrowser on release builds the drawables shouldn't be referenced in any code. Then R8 should be able to remove them, assuming shrinkResources true.
https://developer.android.com/topic/performance/reduce-apk-size#reduce-resources

@greenrobot-team greenrobot-team self-assigned this May 18, 2020
@greenrobot-team greenrobot-team added the bug Something isn't working label May 18, 2020
@rocboronat
Copy link
Author

Thanks for your quick reply! :·)

I checked if I was using AndroidObjectBrowser and nope... and I'm also using shrinkResources true.

I think it's something related to ProGuard. I'm applying this rule, that it's too broad for sure:

# Objectbox things
-keep class io.objectbox.** { *; }
-dontwarn io.objectbox.**

I'm doing it because in some previous version I needed it or you recommended it in the docs or something like that, but now I can't find anything related to it in your readme. Maybe I could remove it? May you confirm it?

Thanks a lot again! 👍

@greenrobot-team
Copy link
Member

objectbox-android ships with ProGuard/R8 rules, you should not have to add your own rules any longer.

@rocboronat
Copy link
Author

Cool. I'll remove them then. Thanks a lot!

I'll try and tell you if those images disappeared.

By the way, maybe it is worth to mention in the readme that no ProGuard rules are needed?

@rocboronat
Copy link
Author

Op, didn't work. The drawables are still there.

@greenrobot-team greenrobot-team added this to the 2.6.1 milestone Jun 16, 2020
@greenrobot-team
Copy link
Member

greenrobot-team commented Jun 30, 2020

With 2.7.0 the objectbox-android artifact will no longer contain any data browser resources. Thanks again.

@greenrobot-team
Copy link
Member

Update: the next version is actually 2.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants