Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Significantly larger Android APK build size after switching to Addressables

Discussion in 'Addressables' started by Epsilon_Delta, Mar 7, 2023.

  1. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    207
    Our build size for Android (.apk) before switching to Addressables was around 136MB and now with Addressables withouth any changes is 166MB = a 30MB increase. If I switch LZ compression to LZMA on all local groups, I get back to around 136MB (before Addressables, build was compressed also with LZ compression). Is this expected?

    My setup is very simple, I converted Resources to one group (packed together), all scenes are in another group (packed together) and then I have Isolated duplicities group (packed together) created from Analyze tool. Unfixable duplicities are few TextMeshPro related assets which need to be in Resources folder unfortunately but they have < 1MB. All the settings are basically defaults with LZ compression.
    Any hints?
     
    Last edited: Mar 7, 2023
  2. marcinovpet

    marcinovpet

    Joined:
    Aug 8, 2022
    Posts:
    1
    I have the same problem. After moving from Resources to Addressables, the build size was increased by 10s of MB.
     
    Last edited: Mar 8, 2023
  3. vadim_unity978

    vadim_unity978

    Joined:
    Feb 11, 2020
    Posts:
    2
    I have the same problem! the build size was increased by 10MB , from 90mb to 101mb
     
  4. abogarsukov-braingames

    abogarsukov-braingames

    Joined:
    Jul 23, 2020
    Posts:
    40
    If your assets are still located in Resources folder, they are most likely duplicated. One copy is still packed within the app, and another copy goes to addressable bundles.
     
  5. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    207
    That's not it in my case. I moved it from Resources folder.
     
  6. abogarsukov-braingames

    abogarsukov-braingames

    Joined:
    Jul 23, 2020
    Posts:
    40
    In this case it might be the addressables catalog itself. Depending on number of assets referenced and addressable group settings it can grow very large. You can find the catalog at `\assets\aa\catalog.json` inside the APK.
     
  7. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    207
    My catalog has few kilobytes, nowhere near 30MB.
     
  8. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    You have duplicated assets within addressables:
    See the Analyze window and use Analyze&Fix to create a duplicates isolation group.
     
  9. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    207
    As I wrote in my original post, I already did that.
     
  10. Alan-Liu

    Alan-Liu

    Joined:
    Jan 23, 2014
    Posts:
    354
    Did you compare the contents of the old 136MB apk which's using Resources and the new 166MB apk which's using Addressables to see which files become larger?

    One possibility is libil2cpp.so, since the Addressables package is added to the project.
     
  11. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    207
    I tried to do that with some tools like folder diff or unity asset store tool Better build info. The problem was that the structure is completely different. It was some time ago and I don't remember all the detail, but I remember it was difficult to compare it.
    My last thought was that once I have time, I will fork Textmesh pro and change it to use addressables. Maybe those textures and resources are copying to all individual bundles or something. It shouldn't be 30MB but who knows.
     
  12. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    207
    Okay I just now had an idea to completely remove TextMesh Pro Resources and try to make a build and TMPro is not cause, the build is smaller only by 1MB
     
  13. jg_od_nz

    jg_od_nz

    Joined:
    May 31, 2023
    Posts:
    2
    Have you tried running apktool to check if the Addressables are being included in the build? I'm having an issue where all of my Addressables are included in my Android build but iOS builds are normal, and so my Android build is much larger than it should be.