Search Unity

Question Upload app larger than 150mb

Discussion in 'Android' started by LucasBrum, Sep 10, 2022.

  1. LucasBrum

    LucasBrum

    Joined:
    Oct 22, 2019
    Posts:
    7
    Hello, I'm trying to upload my app to the play store, but it's too big because of the audios and textures.

    I searched and saw that I should use "Play Asset Delivery" to send my application, but I was not successful.

    The steps I followed were:

    - Add the Play Asset Delivery package.

    - Add the Unity Asset Bundle Browser tool package.

    - Add a tag to my audios (the audios are the ones that weigh the most).

    - Generate the AssetBundle with the Asset Bundle Browser tool.

    - Add the AssetBundle folder in Delivery settings and set the settings to "install time" and check the "Separate base apk asset"

    - Build Android App Bundle

    - Upload to google play

    I can even upload my app but the game doesn't even open.

    Help please!!!
     

    Attached Files:

  2. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Having the same issue over here. I did literally every single thing you mentioned. Every step.

    Even though all my Asset Bundles are under the 1GB limit (according to Google's documentation about Download Size Limits), when I upload the AAB generated by Unity, it says that one of the AssetBundles is over 2048MB. WHAT??

    I'm trying a bunch of different things. I'll report back here if I figure anything out.
     
  3. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
  4. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Thanks for chiming in. Much appreciated. Good question -- Yes, I have followed that documentation. I have:
    1. Downloaded and installed the Android plugin
    2. Meticulously went through all my sprites, sounds, textures, etc. and assigned them to different asset bundles (excluding scripts).
    3. Went to Assets > Build Asset Bundles and created the asset bundles.
    4. Made sure to configure the keystore correctly, as well as the Publishing Settings.
    5. Opened the window under Google > Android App Bundle > Asset Delivery Settings
    6. Checked/Enabled "Separate Base APK".
    7. Added the Folder where by Asset Bundles are (I tried this using the default Asset Bundles folder and a Streaming Assets folder, both located in the main Assets folder).
    8. Set them all to "Install Time".
    9. Then went to Google > Build Android App Bundle and built the AAB. Final AAB is about 1.8GB. But that should be OK, because I would imagine the initial APK that is less than 150MB is somewhere in there. One would imagine, anyways.
    10. Logged into the Google Play Store Console and tried uploading the AAB. It fails because it says that one of the APKs is greater than 150MB.
    Because it fails, I decide to check things out:
    1. Since it failed, I loaded the AAB into Android Studio to see what was going on.
    2. I see that, yes, there are Asset Bundles, and they are all under the 1GB limit each.
    3. But there is a mysterious folder called "Data" which contains 915MB of files, each file is only 15KB to 150KB. It's just a bunch of really small files that add up to 915MB. Weird.
    I tried different variations of the above. Checking and unchecking "Split Application Binary" in the Publishing Settings. I even tried the following:
    1. I ignore the Android Plugin altogether.
    2. I enable "Split Application Binary".
    3. Go to Build Settings, and disable/uncheck "Export project" and check/enable Build App Bundle (Google Play).
    4. Then build the AAB.
    5. Log in to the Google Play Store Console and attempt to unload the AAB.
    6. Again, it will be rejected because it exceeds the limit.
    Now, all that said, I'm looking at your simple response, I realize that I'm not creating a "Base Module" as indicated on the official Android documentation.

    Is that what I'm doing wrong? If so, I have to admit, I can't make heads or tails of that documentation. To be frank, it's obtuse and appears to leave out vital information. It leaves questions open:
    • What namespaces should be on the base module script?
    • Is it simply an empty scene (0 in Build Settings) with one object with the base module script attached? No camera? No nothing?
    • Is Android Google Play Store really analyzing the AAB file to locate scene 0, check to see if it has that base module script, and then using that script to separate the less than 150MB APK and the asset bundles? It just doesn't seem like something the Google Play Store would do, you know?
    • Unity's documentation is really great. Typically namespaces and any pertinent code is displayed altogether, giving the developer a well-rounded idea of what a complete script looks like. However, Google's base module tutorial is... honestly, awful. It lacks a complete example. That said -- Are there any examples of a complete Base Module script, beginning to end?
    Currently my game is out on Steam (PC & Mac), Nintendo Switch, and iOS. Porting to different platforms, I've NEVER ran into an issue that seemed so insurmountable until I've tried to publish on Android. Each attempt to upload an AAB takes at least 1.5 hours. This has drained me.

    And yes, going to Build Settings > check Export project > Build, then pulling it into Android Studio, it runs on an Android device perfectly fine. No issues. Played through the entire thing.

    Definitely a head-scratcher. Any reply would be appreciated. Thanks!
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
    That's correct if you're using Unity's PAD solution you shouldn't need Google's plugin. I would suggest to use bundletool - https://developer.android.com/studio/command-line/bundletool to extract produce aab and explore the contents of the base module.
     
  6. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Thank you for the suggestion. So, to make sure I'm performing the steps correctly:
    1. I do not need to create asset bundles at all.
    2. I just enable "Split Application Binary" in the Player > Publishing Settings (Checking "Release")
    3. Then, go to Build Settings, and disable/uncheck "Export project" and check/enable Build App Bundle (Google Play).
    4. Build the AAB.
    5. Pull the AAB into Android Studio
    6. Run the bundletool according to this official Android Developers video.
    7. Then... uh... build it again in Android Studio???
    8. Then... I guess... upload that to Google Play Store Console???
    Is that correct?

    There are huge gaps in the documentation and everything feels like it was written by computer scientists. It's too bad Android can't make things easier like Apple does with Xcode. That's a breeze in comparison. With Android, everything is extremely tangental and there are a lot of important little steps that just seemed implied.
     
    Fluttershy28 likes this.
  7. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Hello, sorry to bother. Just checking to see if you saw my above question? Let me know. Thanks!
     
    Fluttershy28 likes this.
  8. Fluttershy28

    Fluttershy28

    Joined:
    Jan 15, 2018
    Posts:
    37
    god i'm just running to the exact same issue here, i hope someone explain this clearly
     
    jeremyfryc likes this.
  9. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
    Could you try this:
    * Drop these files in Assets/Editor
    * Then from Unity menu, pick App Bundles->Deconstruct AAB
    * Pick AAB you've built
    * Check apk files in extracted folder next to your aab, and look at base-master.apk, I assume this file will be bigger than 150MB, unzip with 7z and check what files are the biggest ones
     

    Attached Files:

    Trungdv likes this.
  10. Fluttershy28

    Fluttershy28

    Joined:
    Jan 15, 2018
    Posts:
    37
    all right, did as you say, end up with two folders witch the one called asset slices contains a big apk about the size of the aab file and the other called splits has 3 small apk's 2022-09-30 (1).png
    2022-09-30.png
     
  11. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
    Everything looks okay, the base apk is smaller than 150MB and the data apk is less than 1GB.

    Are you saying you can't upload aab?
     
  12. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Hey, sorry I didn't respond. We had to evacuate our area due the hurricane in Florida. Getting back home (no damage!). I did get an hour to try what you suggested... I'm on a Mac.... and 7z. No idea what that is. So, I Googled it and downloaded it from here:

    https://www.7-zip.org/download.html

    I downloaded the MacOS one. No idea how to use it.

    I didn't have a lot of time, so after I imported the scripts you sent, I tried this clicking "Build AAB and deconstruct" (see screenshot):

    Screen Shot 2022-10-01 at 8.00.22 AM.png

    But that didn't really work. I just got an AAB file and bunch of other files in the same folder. I'll have to try this again once I get back home. I appreciate the response. Hopefully we can get this sorted.
     
  13. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
    You should have gotten a list of apks, check their sizes
     
  14. Fluttershy28

    Fluttershy28

    Joined:
    Jan 15, 2018
    Posts:
    37
    no man, the upload work just fine, the app just doesn't work
     
  15. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
    This thread is about uploading, please use a different thread
     
  16. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Apologies for the late reply. It's been a crazy week. OK. So, when I click "Build AAB and deconstruct", I get the following files in an AppBundle folder located in my project folder:

    Screen Shot 2022-10-06 at 10.08.25 AM.png

    Opening the "extracted" folder, I get the following apks:

    Screen Shot 2022-10-06 at 10.08.33 AM.png

    Here are the sizes of those apks:

    Screen Shot 2022-10-06 at 10.09.03 AM.png

    It's important to note that Android no longer supports the uploading of an apk file. You have to upload an aab file now. The only aab file in that folder is the one that says "test", which is 1.56 GM. So, you would think that this is the aab file that contains the split binary apk within it. However, when I upload this "test" aab file to the Play Store console I get this error:

    Screen Shot 2022-10-06 at 10.40.31 AM.png
    This is super weird, because the aab is 100% signed. In fact, you can't even click "Build AAB and deconstruct" without signing it, an error pops up reminding you to sign it. You can even see that it's signed here in the Player Settings:

    Screen Shot 2022-10-06 at 10.40.38 AM.png

    Any help with this would be greatly appreciated. I look forward to hearing back from you soon. Thanks!
     
  17. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
    Yes, I know. You don't need to upload these apk, the point of deconstruction was to see what apk sizes are produced from aab. Because that's what Google does on their side, when you upload the aab, and user is installing your game, Google is sending apk files created from your aab.

    In any case base-master.apk is bigger than 150MB, that's the issue, unzip this file, and check what's taking so much space.
     
  18. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    How about we do one thing at the time and determine the source of the problem.
    Can you try doing thing in the following order:
    1. Disable both .aab and split binary, Build&Run from Unity, does it work?
    2. Enable split binary, Build&Run, does it still work?
    3. Enable .aab, disable split binary, works?
    4. Now .aab + split binary, Build&Run from Unity, does it work?
     
    jeremyfryc likes this.
  19. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    I believe I tried all of those, but let's try it again! I'm on it and I'll get back as quick as I can. Give me an hour :)
     
  20. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    EDIT FROM ABOVE: Just to be clear, yes, my game does work. It's currently available on Steam (Mac, PC), iOS, and Nintendo Switch. Uploading a well-built AAB to the Google Play Store Console Android is where I'm running into the problem. The AAB that Unity builds is always rejected.

    Now, if I build the game in the Build Settings as an APK project, put it into Android Studio, plug in an Android phone, the game runs perfectly fine. So, it's not a matter of if the games runs or not. Again, it's just uploading an AAB that meets Google's restrictions. Unity builds AABs and those are always rejected.

    I looked at the contents of the base-master.apk is a online unzipper. Here are the contents:

    Screen Shot 2022-10-06 at 11.40.05 AM.png

    Every file in the base-master.apk is under 1000 KB (under 1MB). Most are just a few KB. EXCEPT... there is one I found that is 133.71 MB. It's in base-master.apk > assets > bin > Data. In this "Data" folder, the file is called "sharedassets0.resource":

    Screen Shot 2022-10-06 at 11.49.13 AM.png

    What do you guys think this file is exactly? That may be the culprit.
     
  21. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    The base apk file should have your first scene and assets that are used by it. Is your games first scene big?

    Also, you haven't answered regarding unsplit and split .aab when Build&Run from Unity. Forget about Google play for a moment, lets get a split .aab that works locally.
     
  22. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Very good. About the first scene -- no, it's tiny. It's just a logo that displays with an animator component and a scene change script. That's it.

    But about the other stuff, I'm on it. I'll get back here. Thanks!
     
  23. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    OK. I have done what you asked. This is what I did:
    • I plugged in an Android phone via USB, and set that device to the "Run Device" in the Build Settings.
    • I toggled ON "Build App Bundle" in the Build Settings
    • I toggled ON "Split Application Binary".
    • I selected "Build and Run".
    • It works!
    IMG_6886.JPG

    Even so, before it would run on my device, two things popped up:

    Screen Shot 2022-10-06 at 12.29.35 PM.png

    Screen Shot 2022-10-06 at 1.06.49 PM.png

    I had to click "Compute Sizes" in the first message, and then "OK" in the second message.

    What should I do next? Let me know. Thanks!
     
  24. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
    since that file
    This could indicate that you have files in Resources folder (https://docs.unity3d.com/ScriptReference/Resources.html,) since those assets can be accessed via Resources API, they're not connected to any particular scene. So one way to fix this, is to remove/move assets from Resources folder.

    Another option is too choose https://docs.unity3d.com/Manual/BuildSettings.html Compression Method to LZ4, that way those files will be compressed into data.unity3d which might make the whole base-master.apk smaller.
     
  25. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Thank you for your response. I have tried both things:

    Moving assets in Resources folder: My resources folder had three things in it; a Font folder, a Speech folder, and Player/NPC prefabs. The font folder is only 1.5 MB. The Player/NPCs I moved out into their own folder. However, the Speech folder must remain in the Resources folder (I use Adventure Creator, and this asset requires speech files to be in the Resources folder). Even so, all speech files are set to an Asset Bundle, and Asset Bundles are properly created. That said, while they remain in the Resources folder, they really shouldn't be in the base-master.apk file.

    So, I clicked "Build AAB and deconstruct", just to check things out, but there was no change. Of course, I only moved a bunch of prefabs out of the Resources folder, but it was worth a shot. The base-master.apk is still slightly over 150MB, it's at 178MB.

    Compression Method LZ4: I tried this as well. I set the compression method to LZ4 in the Build Settings. Then, I just built the AAB file from the Build Settings. When I uploaded it to Google Play, I got this error:

    Screen Shot 2022-10-06 at 2.05.09 PM.png
    What strikes me as peculiar is that it's referencing the arm64-v8a file here. Is that the file that is being referred to here?

    Screen Shot 2022-10-06 at 10.09.03 AM.png

    What do you think I should try next? I look forward to hearing back. Thanks!
     
  26. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    I don't think it refers to file, it refers to configuration. When you have ARM64_v8a device, what gets installed on it is base apk and the arm64 split apk, the 150MB rules applies to sum of these two. So the goal now should be to get the base apk size down.

    If you create asset bundles for some of resources, why do you keep them in Resources? Why not move them to StreamingAssets? Streaming assets go data asset pack (or it's own separate asset pack).
     
  27. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Good question -- the Resources folder is used by the Adventure Creator asset for Speech files. You can take a look at this on the Adventure Creator forum, in which the creator, Chris Burton, answers this question:

    https://adventurecreator.org/forum/discussion/5253/resources-folder

    So, the Speech files need to remain in the Resources folder. I have about 6000+ lines of dialogue in my game. So, the 133.71MB sharedassets0.resource file couldn't possibly be related to that. Especially since, each speech file is assigned to an Asset Bundle.

    When I move the Speech files out of the Resources folder and into another folder, like StreamingAssets, the speech doesn't play. A warning will come up in the console saying that, for example, "Speech file Player 5609 wasn't found in the Resources folder". This is a warning produced by the SpeechManager.cs script in the Adventure Creator asset.

    The only reason I created Asset Bundles was to create an acceptable AAB file. So, I guess the idea is that by creating Asset Bundles, we are temporarily placing all those Asset Bundle files in another APK, so that we can upload the AAB to the Play Store. Once the game is downloaded, the base-master.apk is combined with that other apk to form one cohesive file. At that time, all those speech files and other assets part of the Asset Bundle apk are placed back in the files there should be. Is this correct?

    Anything else I should try?
     
  28. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
  29. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Thank you for your response. I apologize for not getting back sooner.

    OK. I contacted the developer of Adventure Creator, and it looks like he doesn't recommend the Resources folder either:

    https://www.adventurecreator.org/fo...r-than-the-resources-folder-for-speech#latest

    I have done as he mentions in that thread on the AC Forum. I created a build a without my Speech folder in the Resources folder. I placed it in Streaming Assets... and... nothing changed. The base_master.apk remains at 178MB. So, what is contained in the Resources folder is not the issue. The Asset Bundles are working as they should.

    In summary, I have assigned all assets (sprites, sounds, speech files, etc) to asset bundles, and I have built those asset bundles. That's why the base_master.apk is so small. Even so, I cannot get it under 178MB. I dunno why. There's nothing in the Resources file except for my fonts (1.5MB).

    Any other ideas on how to fix this?
     
  30. shinichikudo997

    shinichikudo997

    Joined:
    Jul 1, 2018
    Posts:
    33
    No solution?
     
  31. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Oh how I wish I could tell you that I figured it out. I ultimately gave up.

    Such a shame too, because publishing my game on iOS brought in a few thousand dollars, so I'm really upset that I can't figure this out for Android. No doubt I'm out a significant chunk of change.

    The problem I think has to do with the GooglePlayPlugins, which you can see in my assets below:

    Screenshot 2023-01-31 at 10.15.23 AM.png

    This necessary file is just a bunch of scripts, but it's over 40 MB! I can't put my game on the Play Store without it, but it's taking up a significant amount of space in the base_master.apk.

    It's almost like Google doesn't want standalone, single player, "pay-once-and-you-own-it" games on the Play Store. They just want cheap, loot-box, free to download, games that someone with a weak internet connection can download. Pretty awful.

    If you have any thing to add to this, let me know! I'm all ears.
     
    shinichikudo997 likes this.
  32. Cuisor

    Cuisor

    Joined:
    Feb 19, 2015
    Posts:
    4
    Seems that Unity's PAD solution on 2021.X version doesn't know what to do with sound files.
    I ended up upgrading the project to Unity 2022.2.15 and now the aab is split the way it's suppose to and I was able to upload on google play store.
     
    jeremyfryc likes this.
  33. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    That's great to know! When I've got the time, I'll update Unity and report back here. Thanks!
     
  34. andronesc5g

    andronesc5g

    Joined:
    May 22, 2021
    Posts:
    1
    Any solution?
     
  35. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
  36. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    49
    Last edited: Mar 4, 2023
  37. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Hey Julius, good question -- I'm still waiting to hear back a response from Unity on the above thread I started:

    https://forum.unity.com/threads/uni...id-sdk-ndk-in-any-unity-2022-version.1403587/

    To summarize, I attempted to update the project to a Unity 2022 version as Cuisor suggested. However, the Android SDK won't download. It just won't do it. I've detailed my actions in that thread. It seems to be an issue with Unity Hub attempting to connect to the Unity server.

    Are you having that issue as well? Did you try updating your project to Unity 2022?
     
  38. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    49
    I haven't tried this in Unity 2022, am currently using 2020 and going through the steps you have outlined earlier in this thread. I'm early in the process (creating asset bundles) and going slow but will post if I can complete those steps properly (or questions about a step).
     
  39. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Sounds good. Let me know what you find out. Thanks!
     
  40. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,085
    heyo any update?
     
  41. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Nothing from Unity :(
     
  42. forkgurock

    forkgurock

    Joined:
    Oct 23, 2022
    Posts:
    1
    hello any update?
     
  43. heyx3

    heyx3

    Joined:
    Sep 19, 2012
    Posts:
    8
    I'm having the same problem, unity 2021.3, inevitably generating a *base/* folder that holds all the content and is way over Google's limits.