Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

How to use Addressables to lower the APK size of an android game?

Discussion in 'Addressables' started by Onur_Yildirim, Nov 8, 2019.

  1. Onur_Yildirim

    Onur_Yildirim

    Joined:
    May 13, 2019
    Posts:
    4
    So I know this looks a basic question but I've been looking everywhere for hours and I'm unable to understand 1 simple concept. Here's how I'm imagining this would work:

    1. Set 5 music mp3 files as Addressable.
    2. Set the addressable group the mp3 files are in as remote build - remote load.
    3. Upload this bundle to a server.
    4. Remove the mp3 files from your Assets folder since they are bundled and uploaded to a remote server to download (This is the thing I don't understand with Addressables)
    5. Call a function to download the files from the server and use them.

    Is this not how this works? I used to do this with asset bundles but I can't seem to understand how to do it with Addressables.
     
  2. JoWi_Uniform

    JoWi_Uniform

    Joined:
    Jul 14, 2017
    Posts:
    4
    Hey there,
    I've just spent some time testing addressables myself, having not used assetbundles before.
    So the issue you're facing is that you don't know how to separate the addressables from your editor build?

    If that's what it is then the answer is that the Addressable assets if set to remote build and load will automatically be excluded from your build.

    At first I wasn't sure about whether this actually happened so I tried some test with a tiny exe and huge addressable files and can verify that they don't get packaged UNLESS you have those addressables somewhere in a scene.
    If they are present in any built scene then they will be included in your build even if they are set as addressable.
    At least this is how it seems to me.

    Let me know if this helps as I had (and still am having a little) trouble getting addressables to work the way that I expected to, it feels to me like the current material / tutorials / talks on Addressables don't totally cover what they need to.
     
    Onur_Yildirim and alan_motionlab like this.
  3. Onur_Yildirim

    Onur_Yildirim

    Joined:
    May 13, 2019
    Posts:
    4
    Yup, after thinking about this for a few hours more, I also realized the same thing. If you DON'T reference it anywhere in the scene they'll be excluded from the end build but it's not covered anywhere in the documents. I also managed to host them on the server and then load them during the first scene. Still, I don't believe it's as straightforward and easy to implement as they're advertising it. Maybe that's because I'm not enough knowledgable on this issue though, will see.

    Thanks for the answer.