Realm binary files take a lot of space in apk file, and include binary files for non-target platform.

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None

      What happened?

      My previous Flutter app takes about 63 MB in apk release build.
      After import Realm, the apk file size become 131 MB, which is double from before.

      By unpack the release package. It turns out that Realm include binary files for all the target platform.
      By default, flutter only build for android-arm, android-arm64 and android-x64. But realm also include android-x86 binary files. Which takes 18.6MB extra space.

      Here is another example , which only target android-arm64 when build:

      So please make realm package follow the flutter --target-platform, this will save a lot of space for release build apks.

      Thank you.

      Repro steps

      1. Use any Flutter project which import realm.
      2. Build android apk, use -target-platform or -split-per-abi.
      3. Unpack the generate apks. Check the realm binary files inside apk.

      Version

      3.19.5

      What Atlas Services are you using?

      Local Database only

      What type of application is this?

      Flutter Application

      Client OS and version

      macOS 13.6

      Code snippets

      No response

      Stacktrace of the exception/crash you're getting

      No response

      Relevant log output

      No response

              Assignee:
              Kasper Nielsen (Inactive)
              Reporter:
              Unito Sync Bot
              Archiver:
              Marc Greenfield

                Created:
                Updated:
                Resolved:
                Archived: