Search Unity

Android App Bundle, how to upload game larger than 100 mb ?

Discussion in 'Android' started by free4allgames, Feb 1, 2019.

  1. free4allgames

    free4allgames

    Joined:
    Dec 5, 2018
    Posts:
    42
    I just tested uploading my game, ~350mb, using android app bundle, according to the documentation, https://developer.android.com/guide/app-bundle/,

    "Publishing with Android App Bundles also increases the app size limit to 500MB without having to use APK expansion files."

    However when I upload the 350mb aab file to the store this is what happens :



    Any ideas ?
     
  2. free4allgames

    free4allgames

    Joined:
    Dec 5, 2018
    Posts:
    42
    So, does anyone here tried this "new" upload method and got it to work ?
     
  3. free4allgames

    free4allgames

    Joined:
    Dec 5, 2018
    Posts:
    42
    This is the reply I got from google...



    However with Unity that doesn't seem very possible to do ?

    If I build with Split Application Binary I can't upload the expansion file to the AAB build in Google Console, if I don't, then the APK gets the full content and goes over 100MB...

    Is there really nobody who tried this ?
     
  4. free4allgames

    free4allgames

    Joined:
    Dec 5, 2018
    Posts:
    42
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    aab is kinda useless right now, until they change the APK limit from 100mb to 500mb (specifically for aabs though).

    The feature (going from 100mb to 500mb) is in early access now, some developers have it, others don't. It will (soon?) be available to everyone. So if you can, wait until then.
     
    Paul_Hughes likes this.
  6. free4allgames

    free4allgames

    Joined:
    Dec 5, 2018
    Posts:
    42
    From what I understood the limit is really 500MB, but the APK must be 100 MB.

    This is, unity should make things differently when we choose split apk with aab so that we can raise the limitation...

    Right now what we do is make essential content attached to the first scene and choose split binary, unity will make a small(ish) apk under 100mb and then the obb with the remaining content.

    We then upload both those files to google play and google play delivers them to the client, this process works but has issues as the infamous wrong access permission to the obb file which forces us to request read/write permission to the user device external storage for the obb file to be accessed, even though we shouldn't need it. (This is an android issue, not an unity issue.)

    But with aab files unity would need to generate the android project using the new "system", instead of creating a separate obb file the project needs to use this : https://developer.android.com/guide/app-bundle/playcore

    And then we hopefully no longer need to worry with obb files.

    I'm not experienced with android projects, but I will take a look into it when the time allows... Maybe it's an easy fix, maybe not.

    I wish the guys at unity looked into it since they probably know a lot more about this than me.
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    That's not correct.

    The aab itself it can be larger than 500mb as long as the resulting APKs are less than 500mb.

    But the Google Play Store itself still only allows for 100mb max files to be downloaded from it, so...
     
  8. free4allgames

    free4allgames

    Joined:
    Dec 5, 2018
    Posts:
    42
    Yes, but then with the feature I linked you download the remaining files on demand, which allows up to 500mb games.

    The initial apk must be smaller than 100mb.
     
  9. KrcKung

    KrcKung

    Joined:
    Jul 18, 2017
    Posts:
    56
    I believe that is the case, since this is what stated in https://developer.android.com/guide/app-bundle.
     
  10. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    Read the Known Issues section
     
  11. free4allgames

    free4allgames

    Joined:
    Dec 5, 2018
    Posts:
    42
    Yes, this is the part I'm talking about and linked above :

    "So, users can download apps as large as 500MB and, with dynamic delivery"

    However I still haven't figure out how to use dynamic delivery with Unity, this is what I'm asking here.
     
  12. imaginalis

    imaginalis

    Joined:
    Feb 20, 2015
    Posts:
    29
    free4allgames likes this.
  13. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    ProdiggaPA likes this.
  14. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
  15. free4allgames

    free4allgames

    Joined:
    Dec 5, 2018
    Posts:
    42
    I'm glad I didn't waste my time trying to implement this in Unity then...

    Doubt this is a typo.
     
  16. Cuicui_Studios

    Cuicui_Studios

    Joined:
    May 3, 2014
    Posts:
    72
    Hi, looking to this post maybe you can help me. I'm a bit stuck uploading my app to the store.

    I tried the App Bundles but my app exceeds the limit of mb so I tried to split it by architecture, but when I upload it to the store it says that I have codes and libraries that are not need so I can use those apks neither.

    I look into my plugins folder and don't see any plugin with checks for different Android architectures so I can't figure out where the hell are those libraries.

    Does any one have a trick for this kind of issues?
    Thank you in advance :D
     
  17. free4allgames

    free4allgames

    Joined:
    Dec 5, 2018
    Posts:
    42
    If you're talking about the new warnings google created you can safely ignore them.

    Google wants people to use the new AAB but they ignored the fact that games can be larger than their 150mb limit and annoys us with useless warnings.

    If your game cannot be uploaded using AAB you have no choice AFAIK.

    What you should do:

    Always try to send the game first with AAB to avoid issues, choose "Split APK by target architecture" and uncheck "Split application binary", then check "Build App Bundle" and build, it will create a single AAB file you send to google, the AAB file can be larger than 150mb, google will create the apk file for your on their end, and if the APK they generate has more than 150mb they will not let you upload the game.

    It is the best way to upload the game now, and if your game is only a few MB above the limit you should try to lower it (compressing more textures, audio files, removing any possible garbage, etc).

    Now, if you have no way to lower it further (like my game is 400mb due to many textures needed), you have to do it the "bad" way.

    You will have to check "Split APK by target architecture", check "Split application binary" and unckeck "Build App Bundle". When you build unity will ask for a folder and create 4 files, 3 are apk files by architecture, 1 arm7, 1 x86 and one x64, and the other is the obb file.

    When you upload to google then you need to upload all apks (in the same release, it will show the different versions when you upload), then FOR EACH APK uploaded, you have to add the obb file, you have to repeat this for every architecture, Google will once again warn you that you're uploading the same file 3 times (the obb file is the same indeed), IGNORE it, if you don't do it this way the game will not work.

    Google will then complain with more warnings, you have no choice but to ignore.

    This also comes with the problem of a known bug on androids, when the game is downloaded from google play the obb file has the wrong owner set to it, and so your game will now need access external storage permission to access the obb file or it will once again not function since it cannot access the obb files, this means you need to put a request for a permission to access the players personal photos (this is what the permission message actually says) even when you're not doing it, just because of a bug on Google's code, and they won't fix it! Bug related: https://issuetracker.google.com/issues/37075181
    If the player refuses the permission the game will only work after a device reboot, this means the first scene in your Android Unity game has to be a scene forcing the permission request and not allowing the game to continue unless you have the permission...
     
  18. Cuicui_Studios

    Cuicui_Studios

    Joined:
    May 3, 2014
    Posts:
    72
    Thank you @free4allgames !

    I'm at the bad case like you :(. I already tried the steps you said but I can't click the launch button even on internal test, it is like I can't ignore the warnings. I sent a ticket to Google because I do not know what more to try without downgrade the assets as you said, but some one here will kill me if I compress it more xD
     
  19. Cuicui_Studios

    Cuicui_Studios

    Joined:
    May 3, 2014
    Posts:
    72
    Forget it, my client didn't complete all store data ¬¬. Sorry, so many frustation that I didn't notice
     
  20. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    But they forgot to make it worth using. Fun!
     
  21. mbrindic

    mbrindic

    Joined:
    Mar 13, 2014
    Posts:
    16
    Hello guys, can anyone tried publishing the app with with play stores "Unoptimized app" warning?
    I need to publish the game in next month, so does this warning stopping us publishing the game?
    Thanks!
     
    Last edited: Jul 25, 2019
  22. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    No it doesn't.
     
  23. mbrindic

    mbrindic

    Joined:
    Mar 13, 2014
    Posts:
    16
    Great, thanks @AcidArrow!
     
  24. ABerlemont

    ABerlemont

    Joined:
    Sep 27, 2012
    Posts:
    67
    I managed to upload a build 2 weeks ago through that process : thumbs_up :
    But since this morning I can't rollout anymore because :

    I still can't add .obb through the aab process on the android console.
    What's left to be done for bigger games ? :/
     
    Last edited: Aug 12, 2019
    Calebsem and Eternity774 like this.
  25. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    883
    Just as an update to anyone hitting issues uploading builds to Google Play with the new 64-bit requirement:

    You must disable x86 android output in order to upload to Google Play. If you upload an APK with x86 support, it must also have x64 support (which Unity doesn't seem to have yet). Unity does have ARM and ARM64, which is what almost all devices will be using (except for emulators).
     
    Spiros_Learity likes this.
  26. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
    There won't be x64 support for Android builds. And ARM Android binaries can run in x86/x64 based devices.
     
  27. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    My last update of the game online is 151-152MB. Now it's too much so I've reduced about 10MB but still it's not enough. I can't upload to Google Play anymore.
     
  28. MotionBrain

    MotionBrain

    Joined:
    Dec 5, 2015
    Posts:
    35
    Hey Guys,

    so how is it possible to upload an app with over 100MB?

    Regards

    Joachim
     
    Rachan likes this.
  29. JustAnotherDude

    JustAnotherDude

    Joined:
    Oct 28, 2013
    Posts:
    279
    If you use Android App Bundle you can go up to 150MB. With Unity expansion files are not supported wih AAB.

    The standard method is still 100MB but you can add obb files with 2GB.
     
  30. Sholz

    Sholz

    Joined:
    Dec 12, 2016
    Posts:
    20
    The way it stands we basically have only one option...and that's aab files (which can oly be less than 150mb) .... because even uploading apk and obb file still gives errors.....wonder how bigger studios will publish content.


    upload_2020-2-12_22-7-2.png
     
    GameLover90 and skunight like this.
  31. Sholz

    Sholz

    Joined:
    Dec 12, 2016
    Posts:
    20
  32. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    That’s a warning, not an error. You can simply not use .aab and keep using apk and obb files.
     
  33. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
    Games do download content from CDN (with Unity you can do asset bundles). No need to put everything in original binary package.
     
  34. elbaronjack

    elbaronjack

    Joined:
    Jun 5, 2018
    Posts:
    1
    We finally could upload a version of our big proyect in the PlayStore following this steps:

    - Check "Split Application Binary", and uncheck "Target Architectures -> x86 (deprecated)" and the f**king "Build App Bundle (Play Store)".
    - Make an empty scene and set it's build index has 0 (adjust your project to deal with it).
    - Upload your apk and your obb.

    The error was the deprecated x86 version of the proyect was making troubles when tring to upload the project to Google Play Console. It also work if you check "Split APKs to target architectures" and upload the 2 versions with the same obb at the same time.
     
  35. AbraTabia

    AbraTabia

    Joined:
    Jul 21, 2019
    Posts:
    11
    I had this issue (and fixed it) for the first time and read *most* of the posts on here, so just in case this wasn't noted already, that 500MB limit that you may have read in some old google docs never actually happened. They were planning on making 500MB the limit but it never got through their beta testing, and stayed at the 150MB limit for app bundles and 100MB for apk files. I am mentioning this because when I google'd this my first results were still telling me that 500MB was the limit, I noticed the posts were 2 years old and then found the thread google made saying that they decided not to go as high as 500 and stuck to 100, and 150 for app bundles. So just making that clear to anyone else new to this that is confused when they see the 500MB limit on google help forums and gets confused that it doesn't match their google play console.

    After playing around with my project, I learned how the apk file size works. It is based on the first scene of the project, so if you have a heavy graphic first scene which turns out to make the apk file over 100MB, you have to either reduce your first scene until it hits 100MB or less, or make a loading scene that either does something simple or just redirects to the normal main scene (moved to the 2nd slot). I made mine just print the word loading on a canvas and put a script in that scene that just loads the next scene. Dropped my apk size to 35MB and just tacked the rest on to the obb file. And the apk size was 20MB before I added textmeshpro and an animation to the loading text, so it's almost entirely based on the amount of assets required for the very first scene of your project.
     
  36. stuart567

    stuart567

    Joined:
    Jun 21, 2017
    Posts:
    3
    This cant be right surly? My first scene is my main menu which is just an empty scene with a canvas yet m game comes to 260mb.
     
  37. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    That person is talking about obb expansion files and the information is correct. Have you enabled the editor option to split the app binary? https://docs.unity3d.com/Manual/android-OBBsupport.html
     
    goldcloud144 likes this.
  38. a-dolbilov

    a-dolbilov

    Joined:
    Jun 4, 2013
    Posts:
    17
  39. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    I'm confused though, can we use that without having to use Unity's Asset Bundles? (and just upload a large .aab)
     
  40. a-dolbilov

    a-dolbilov

    Joined:
    Jun 4, 2013
    Posts:
    17
    As far as I understand, nope! You have to use Asset Bundles or another binary data format.
     
  41. a-dolbilov

    a-dolbilov

    Joined:
    Jun 4, 2013
    Posts:
    17
    As I understand Unity programmers can easily solve this issue by placing data.unity3d file into their own Asset Pack with AssetPackDeliveryMode.InstallTime, and patch data.unity3d loading. The only thing Unity clients should do for this case is to set Compression Method to LZ4(HC). This approach can solve 99% of apk->aab migration issues.
    Google plugin on the other side is very helpful for OnDemand and FastFollow asset packs.
     
    AcidArrow likes this.
  42. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    Yeah, that's my conclusion as well...

    Any chance of that happening @JuliusM ?
     
  43. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    Many many years after Asset Bundles are introduced, they still seem like an absolute pain to set up.

    I thought I'd set up some kinda of "an asset bundle per type of asset", so that our builds will be sufficiently split for Google, or whatever, but it's still very convoluted to do? (especially since our project has a ton of unused assets, depending on the build target).

    Plus we'd have to refactor a lot of our code to load the bundles first instead of just referencing assets?

    And all of that just because Google insists on not allowing larger APKs, and Unity does not want to make Asset Bundles make sense?

    Am I missing something?
     
    ChrisP999 likes this.
  44. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    So where / who do I need to keep spamming to make Unity consider this? There are plenty of people that don't care about dynamic delivery and restructuring our game to use Asset Bundles, when we don't care about dynamic delivery and just want to use our local assets, is a ton more work for no real benefit.

    Maybe Unity could have the equivalent of split APK / OBB feature, only instead its split aab / asset pack with InstallTime and then Unity just loads it without us needing to change any code and then we can all happily transition to it and leave OBB files in the past where they belong.

    Google people I've contacted seem to think it's a good idea, but I (and also they) don't believe it can be done purely from their plugins without also internal changes from Unity.

    So, again, who do I need to pester to at the very least have this idea properly considered and evaluated?

    @JuliusM @Tomas1856 @Yury-Habets @Aurimas-Cernius
     
    IARI, dacarrera, dimmduh1 and 2 others like this.
  45. diego_unity680

    diego_unity680

    Joined:
    Apr 17, 2020
    Posts:
    2
    Just wondering how I am supposed to load an AAB bigger than 150Mb?
    Google won't allow the upload otherwise.
    I know about moving the data in an asset bundle, etc but in case you can't, there is no solution?
    The OBB used to be the escape route in this case, has it been exchanged with nothing?
    Just 150Mb, that's it?
     
  46. JustAnotherDude

    JustAnotherDude

    Joined:
    Oct 28, 2013
    Posts:
    279
    You can use the APK with OBB files (all hosted at google play) or you can use AAB (on GP) with Assetbundles (hosted on your own).
     
    ocnenued likes this.
  47. quintonleongnam

    quintonleongnam

    Joined:
    May 9, 2018
    Posts:
    9
    @AcidArrow I feel you completely! I've been facing the same problem and indeed we need a solution from both Unity and Google to help make it so that we don't have to change or add code just to draw out asset packs so that that we can achieve the same result we would have gotten if bigger apks were simply allowed! We either need a non add code solution to set up Play asset delivery or Google needs to refine the Android app bundle so that it can auto split the .aab file in to smaller apks that actually are able to fit on their own platform.

    if anyone can point you in the right direction, I'd be happy to spam the relevant people along with you!

    @anyone new following this feed who might need help with the splitting of the game into apk and obb files, this is the video I used to help me:


    My game has just gone up on the store and is awaiting approval. Currently I am struggling to test my split apk and obb so I really hope it works first off!>< well just have to wait and see.

    Quick questions though: @free4allgames mentioned (thanks so much for the info btw) that the apk obb split has a problem when downloading from the store. Do you or anyone know how I can get the game to request that permission? do we need to add code in game to request or is that a thing I have to check mark through the google play store?

    Also has anyone uploaded a game with the apk and obb files? Has yours worked straight off? or was there a long testing phase where tweaks were needed to make it work before publishing?

    Any help or advice would be greatly appreciated.

    Thanks to all in this thread for the discussion, great to know I'm not the only one experiencing this and I've learnt alot as well!
     
    IARI likes this.
  48. JustAnotherDude

    JustAnotherDude

    Joined:
    Oct 28, 2013
    Posts:
    279
    It's not such a difficult task these days and the problem seems to happen on fewer devices as time goes by, anyway heres my solution:

    1-Add a texture to test if the obb is reachable, that texture has to be on the resources folder and cannot be referenced anywhere in your project:
    upload_2020-9-2_23-27-5.png

    2-Create an splash scene that will contain your permission request and check if you need to ask the permission. Make it your first scene.

    3-Add code to check if obb is reachable:


    Code (CSharp):
    1.     private bool IsObbAccessible()
    2.     {
    3. #if UNITY_ANDROID
    4.         try
    5.         {
    6.             Texture2D obbtest = Resources.Load<Texture2D>("obbtest");
    7.                 return obbtest != null;
    8.         }
    9.         catch
    10.         {
    11.             return false;
    12.         }
    13. #else
    14.         return true;
    15. #endif
    16.     }
    4 - If the Obb is not accessible, ask for permission:


    Code (CSharp):
    1.     public void RequestPermission()
    2.     {
    3. #if UNITY_ANDROID
    4.         Permission.RequestUserPermission(Permission.ExternalStorageWrite);
    5. #endif
    6.     }

    You can follow development of that permission class here:

    https://forum.unity.com/threads/the-android-permission-class-needs-serious-improvements.705770/


    edit: You do need to make the request permission screen yourself, but just put a text explaining why you want that permission then a button that calls RequestPermission and you're done.
     
    Voxel-Busters likes this.
  49. quintonleongnam

    quintonleongnam

    Joined:
    May 9, 2018
    Posts:
    9
    @JustAnotherDude Thanks ever so much for such a great detailed solution! Much appreciated indeed! I'll give it a go!
     
  50. JustAnotherDude

    JustAnotherDude

    Joined:
    Oct 28, 2013
    Posts:
    279