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. Dismiss Notice

APK size problem while publishing my game on google play store.

Discussion in 'Editor & General Support' started by blackcode101, Mar 24, 2021.

  1. blackcode101

    blackcode101

    Joined:
    Jul 10, 2020
    Posts:
    6
    hi,
    its my first ever game i want to publish and i dont have that much of experience. consider me a new guy.
    so my situation is:
    after building my game i got an APK of size about 280 MB and clearly i am not able to upload it to google play console because of the size limitation. please help me out here what should i do to make the size of the APK small enough to be accepted by google play console.
    in unity build settings i did try "Build app bundle" which gives me 219MB file.
    in player settings i tried the "Split Apks by target architecture" and "Split Application Binary" in Publish Settings, producing 3 files:
    1: .arm64-v8a.apk (63 MB)
    2: .armeabi-v7a.apk (61 MB)
    3: .main.obb (219 MB)

    I tried the first APK in my mobile its not a complete game. game just started and goes nowhere from the main menu.
    I am lost here i dont know what else to do. I really need a quick help here. easy and fast solution i guess for a new guy like me will be the best.
    Thank you.
     
  2. sandstedt

    sandstedt

    Joined:
    May 24, 2015
    Posts:
    64
    Are you baking light-data, or having any other huge files in your game? Then try removing as much as possible, check for large texture files, sound files or any other binary files that could take a lot of space.

    You can read more in the manual how to check that takes the most place here: https://docs.unity3d.com/Manual/ReducingFilesize.html

    But would advice you to try getting your mobile game under 50mb. Else your game will be the first to go, then the player runs out of memory on their device, or not being downloaded at all. And always keep an eye on the build size during development.
     
  3. blackcode101

    blackcode101

    Joined:
    Jul 10, 2020
    Posts:
    6
    Thank you for such a detail explanation, its a big help for me. i am going through each audio file and doing compression to reduce each audio file size and then will go through images and animation.
    but if may i ask: what about those huge games online which initially have small size but once we download it and open it, it starts updating and keep on downloading more data.
    how can i do it here? or is it possible with unity and google play console?
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,710
    You can split the APK into an APK and OBB. It's a silly engineering nightmare foisted upon us by phone carriers and the download limitation, but it does work once you get it set up.

    OR... you could use Unity Asset Bundles or Addressibles to download further content after launch, in which case you need to host that content somewhere world-accessible.
     
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Compressing files like audio and images in the Assets folder doesn't necessarily affect build size, because Unity stores the data from those files in the build in its own internal format which is unrelated to the original file type.

    From the manual:
    https://docs.unity3d.com/Manual/ReducingFilesize.html

    Note on that same manual page there are some other possibly helpful tips for reducing build size.

    On audio specifically, I would expect you could reduce the size in the build by reducing quality. Such as switching the files from stereo to mono, or reducing bit rate.
     
  6. Reshima

    Reshima

    Joined:
    Dec 10, 2012
    Posts:
    51
    The huge games you refer use Asset Bundles or Addressables (which uses Asset Bundles behind the scenes). You basically store the assets in the "Cloud" (AWS S3 or GCP Cloud Storage for example) and download them when the game starts. It does require quite a bit of refactoring though to migrate to this system as you cannot reference your assets directly anymore otherwise they will be bundled with your app and you don't want that.

    If your game is exclusively distributed on Android, I'd also recommend taking a look at the relatively new Asset Delivery: https://developer.android.com/guide/app-bundle/asset-delivery
     
  7. blackcode101

    blackcode101

    Joined:
    Jul 10, 2020
    Posts:
    6
    Thank you all for your time and valuable advises it was really a big help. this week i was busy in reading, understanding and implementing guidelines you all advised. @sandstedt i did follow this document: https://docs.unity3d.com/Manual/ReducingFilesize.html to reduce the sizes of my textures and audio files and luckily i managed to reduce the overall size of my APK from 280 MB to 84 MB. i really appreciate you shared these information with me.
     
    Kurt-Dekker likes this.