Skip to content

Two drawables are being put in the release APKs #857

Closed

Description

@rocboronat

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! :)

Activity

  1. greenrobot-team commented on May 18, 2020

    @greenrobot-team
    Member

    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

  2. rocboronat commented on May 18, 2020

    @rocboronat
    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! 👍

  3. greenrobot-team commented on May 18, 2020

    @greenrobot-team
    Member

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

  4. rocboronat commented on May 18, 2020

    @rocboronat
    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?

  5. rocboronat commented on May 18, 2020

    @rocboronat
    Author

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

  6. added this to the 2.6.1 milestone on Jun 16, 2020
  7. greenrobot-team commented on Jun 30, 2020

    @greenrobot-team
    Member

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

  8. greenrobot-team commented on Aug 3, 2020

    @greenrobot-team
    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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions