Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

AAB support : does that mean we don't need to use PAD ?

Discussion in '2021.2 Beta' started by bali33, Jun 22, 2021.

Thread Status:
Not open for further replies.
  1. fangye_Studio

    fangye_Studio

    Joined:
    Nov 19, 2012
    Posts:
    30
    hi @JuliusM , I just tried 2019LTS to make my game to fit google AAB+PAD requirement , with customized path gradle 6.1.1 , I made out the app as AAB+PAD and uploaded to google play console successfully. but I am suprised about the size difference .

    the local AAB+PAD file size is around 460MB, I can see it includes base.apk and unityDataAssetPack.apk .
    the size in google play app bundle explorer also seems same around 460MB,but once I tried the internal testing , I found the app download size in google play is around 1GB.

    I explored the local AAB file a bit , and just found inside the base.apk is 15MB size and packed as 14.9MB, but the unityDataAssetPack.apk size is 1GB and packed as 438MB . so it seems google play just released this uncompressed 1gb apk size as download size (install -time mode) .

    I tried build out the traidional apk , the size is same around 450MB , even previous aab+oob , also total less than 460MB, which is good for download size . so I am confused is this the correct and reasonalbe download size for this new publish pipeline ?
     

    Attached Files:

  2. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    516
    The OBB file that Unity packs automatically is just a ZIP file with .obb extension, so it is compressed.

    Google said that asset packs in AAB will be uncompressed unless specified during build.

    https://developer.android.com/reference/com/google/android/play/core/assetpacks/AssetLocation.html
     
  3. fangye_Studio

    fangye_Studio

    Joined:
    Nov 19, 2012
    Posts:
    30
    hi, @Neonlyte thanks for your reply , I still feel blur and confused about this .

    the attached pic is what I see in AAB file using 7-ZIP explorer.
    the unityDataAssetPack seems packed with compressed ,but in google play installation it become the original size. it may be due to the the google reference you post, so is there anyway to set it as a compressed asset it in Unity building process with 2019 OR 2020LTS, or I have to use google plugin to mannually pack asset ?
     

    Attached Files:

  4. lawsonh

    lawsonh

    Joined:
    Jul 25, 2018
    Posts:
    83
    If I was previously using assetbundles with PAD unity plugin provided by google, what is the difference between that and this new Unity feature?

    My game is less than 1 GB but, I would like to use ondemand style loading rather than install time. Does that mean I still need to use the unity plugin by Google?
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    12,015
    I'm pretty sure the answer is yes.

    As was said previously, the purpose of this feature is to provide a bridge to people who were relying on APK+OBB.
     
    lawsonh likes this.
  6. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    You can create custom asset packs with on demand delivery type using the Unity feature. Then you will have to adapt your game logic to ensure that the custom asset pack is downloaded and that the bundle is loaded from the asset pack location.
    If you are using Addressables, then you can take a look at this sample https://github.com/Unity-Technologies/Addressables-Sample which shows how to set up Addressables to work with Play Asset Delivery feature in Unity.
     
    LeonhardP likes this.
  7. lawsonh

    lawsonh

    Joined:
    Jul 25, 2018
    Posts:
    83
    Awesome, thanks a lot. I am using asset bundles. Do you know if there is any benefit to changing to the Unity feature in my case?
     
  8. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    If you have already set up everything and it works for you, then there are no immediate gains you would get by switching from plugin to built-in solution. However the drawback is that you depend on the 3rd party plugin's compatibility with Unity. Some changes (either in plugin or in Unity) could break the compatibility in the future.
     
    lawsonh likes this.
  9. Gamedelta

    Gamedelta

    Joined:
    Dec 29, 2019
    Posts:
    6
    When i build my application, Unity generates an Android App Bundle and not generate asset packs.
    How generate asset packs?
     
  10. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    Did you follow instructions in https://docs.unity3d.com/Manual/play-asset-delivery.html ? note: the documentation page is for the latest LTS version, which currently is Unity 2020.3, make sure to select your Unity version in the top left.
    Also note that asset packs will be inside of the AAB, they will not be separate files.
     
  11. Gamedelta

    Gamedelta

    Joined:
    Dec 29, 2019
    Posts:
    6
    Hi, @JuliusM thanks for your reply.
    Yes i follow instructions and use Unity 2020.3.17f1.
    Don't undestand about "inside of the AAB". My AAB file before split was larger than 200 mb and works fine on device, after split AAB became 40 mb in size and don't work on device.
     
    Last edited: Aug 31, 2021
  12. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    Do you see any warnings in editor's console when building the player? Do you use Addressables package? Do you have custom scripts which modify project files after the gradle project is built?
     
  13. Gamedelta

    Gamedelta

    Joined:
    Dec 29, 2019
    Posts:
    6
    There are no warnings, there are no scripts that modify the project files, one of the projects has Adressables (only sounds), the other does not, but the result is the same for both.
    upload_2021-9-1_11-24-27.png
     
  14. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    I see, then I am out of ideas. This will need to be investigated. Please report a bug https://unity3d.com/unity/qa/bug-reporting after that you can paste the 7 digit issue number here as well, so I would be able to track it right away.
     
  15. Gamedelta

    Gamedelta

    Joined:
    Dec 29, 2019
    Posts:
    6
    I found the cause of the problem. In the launcherTemplate.gradle file, you had to replace **PACKAGING_OPTIONS****SPLITS** with **PACKAGING_OPTIONS****PLAY_ASSET_PACKS****SPLITS**.
     
    lenchez-mrg and JuliusM like this.
  16. 20V

    20V

    Joined:
    Mar 15, 2015
    Posts:
    1
    Just in the nick of time for this to arrive in unity. However I just tried, Earlier my app was 600+MB and now the ABB which came out was only 49MB. definitely something is wrong? Do you know anything about this? @JuliusM
     
  17. virgilcwyile

    virgilcwyile

    Joined:
    Jan 31, 2016
    Posts:
    73
    Same issue for me, I am using Unity 2019.4.29.
     
  18. virgilcwyile

    virgilcwyile

    Joined:
    Jan 31, 2016
    Posts:
    73
  19. virgilcwyile

    virgilcwyile

    Joined:
    Jan 31, 2016
    Posts:
    73
    That worked, but getting a warning of apk size more then 150MB
     
  20. lawsonh

    lawsonh

    Joined:
    Jul 25, 2018
    Posts:
    83
    That's normal I think. You can ask it to calculate the size range after and make sure that is lower than 150mb
     
  21. virgilcwyile

    virgilcwyile

    Joined:
    Jan 31, 2016
    Posts:
    73
    This is my AAB file, I don't see APK + OBB in it. Is it good to go?
     

    Attached Files:

  22. lawsonh

    lawsonh

    Joined:
    Jul 25, 2018
    Posts:
    83
    Yeah thats good. theres no more apk/obb. the packs are embedded in the AAB. When you upload to google play it'll calculate the size automatically and if the underlying binary is higher than 150mb you will be rejected
     
  23. virgilcwyile

    virgilcwyile

    Joined:
    Jan 31, 2016
    Posts:
    73
    I received this error when uploaded on Google Play-
    An error occurred while running bundletool build-apks on your uploaded App Bundle. Ensure that your App Bundle is valid by running bundletool build-apks locally and try again. Learn more. Error: Both modules 'base' and 'UnityDataAssetPack' contain asset entry 'assets/bin/Data/UnitySubsystems/UnityARCore/UnitySubsystemsManifest.json'.
     
  24. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    This will probably be the problem with ARCore package. Please submit a bug report, feel free to paste the 7 digit bug report number here. Thank you.
     
  25. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    Take a look at this post https://forum.unity.com/threads/aab...t-need-to-use-pad.1129876/page-2#post-7464992 you are most likely in the same situation. If you have custom gradle templates, you will have to add an entry for asset packs. Alternatively you can recreate your gradle templates based on the default templates in the new Unity version and then do your custom modifications on top.
     
  26. virgilcwyile

    virgilcwyile

    Joined:
    Jan 31, 2016
    Posts:
    73
    Can you create a bug report? The project is big so it seem to fail.
     

    Attached Files:

  27. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,143
    Seems like some of the files in the project folder are locked. Can you please check if they are opened in a third party tool, like Visual Studio? Instead of attaching the project folder directly, you can try to create an archive of the relevant project files and attach that.

    There is no limit to the size of the attachments that the bug reporter accepts.
     
  28. virgilcwyile

    virgilcwyile

    Joined:
    Jan 31, 2016
    Posts:
    73
    Here is the case number. 1362901
     
  29. allpublic

    allpublic

    Joined:
    Nov 10, 2020
    Posts:
    20
    I run into the same issue with 2021.1.19f1.
    I found a workaround with 2020.3.17f1.

    And used these Special Project Settings:
    Split Application Binary: true
    Scripting Backend: IL2CPP
    Minimum API Level: Android 11
    Deinstalled Google Bundle Plugin


    Custom Gradle Properties Template:
    Code (CSharp):
    1. org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M
    2. org.gradle.parallel=true
    3. android.enableR8=**MINIFY_WITH_R_EIGHT**
    4. unityStreamingAssets=.unity3d**STREAMING_ASSETS**
    5. **ADDITIONAL_PROPERTIES**
    6. android.useAndroidX=true
    7. android.enableJetifier=true
    I don't know if the package is alright yet but the upload was accepted, so looks like the split in Parts worked.
     
  30. virgilcwyile

    virgilcwyile

    Joined:
    Jan 31, 2016
    Posts:
    73
    Were you able to check the Issue? 1362901 is the case number.
     
  31. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,143
    The report is with QA. It will take some time for it to get processed.
     
  32. CurrentStudios

    CurrentStudios

    Joined:
    Aug 27, 2014
    Posts:
    5
    Any update on this? Running into the same issue preventing me from uploading my app to Google Play.
     
  33. virgilcwyile

    virgilcwyile

    Joined:
    Jan 31, 2016
    Posts:
    73
    Hi @LeonhardP , To get better support do I have to update my Unity plan? Please let me know. Issue is causing us to release the build.
     
  34. virgilcwyile

    virgilcwyile

    Joined:
    Jan 31, 2016
    Posts:
    73
    Hi @LeonhardP Here is the response I Got,
    "the error "Both modules 'base' and 'UnityDataAssetPack' contain asset entry 'assets/bin/Data/UnitySubsystems/UnityARCore/UnitySubsystemsManifest.json'." is already known and being tracked here: https://fogbugz.unity3d.com/f/cases/1360010/ this is an issue related to ARCore. Would it be possible for you to test uploading again after this fix has landed? If you will still encounter this issue contact us again."
    But I am not able to login to the link to see the resolution.
     
  35. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,113
    LeonhardP likes this.
  36. pf_ana

    pf_ana

    Joined:
    Sep 12, 2021
    Posts:
    9
    This is Awesome. we already use this in release product.
    But we need some help.
    98% of user can play the game well.
    But some Android Device, like vivo Y20 or vivo Y20i, user get the "Unable to Initialize the Unity Engine",
    There users need to reopen the game several time for play the game once.
    we thought the reason is some assetpack or dll load too slow ?
    we can't reproduce this bug. Please help. @JuliusM @LeonhardP
     
    Last edited: Oct 11, 2021
    Energy0124 likes this.
  37. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,143
    We'll need to be able to reproduce this issue locally in order to investigate this. Could you please submit a bug report with a reproduction project attached and specify what device this issue occurs on?
     
  38. domonyiv

    domonyiv

    Joined:
    Oct 1, 2016
    Posts:
    79
    @LeonhardP @pf_ana I have the same problem (There users need to reopen the game several time for play the game), but the message is different (Not enough storage space to install required resources) I already submitted a bug report with the project attached and it can be reproduced on Huawei Honor 4C - Android 6.0.

    The Split Application Binary and Build App Bundle options must be turned on to able to reporduce it.

    Please note, if I change the Build Compression method to Default from LZ4 the problem goes away!

    FogBugz id: 1372558
    Topic: https://forum.unity.com/threads/not-enough-storage-space-to-install-required-resources.1063934/
     
    Energy0124 and LeonhardP like this.
  39. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,143
    Thanks for the report and for flagging it!
     
  40. domonyiv

    domonyiv

    Joined:
    Oct 1, 2016
    Posts:
    79
    Unfortunately I was wrong with the "if I change the Build Compression method to Default from LZ4 the problem goes away" part. "Unable to Initialize the Unity Engine" happens once in ten starts. @pf_ana @LeonhardP
     
  41. pf_ana

    pf_ana

    Joined:
    Sep 12, 2021
    Posts:
    9
    Sorry, When i create a new empty project. Use same setting. The issue doesn't happen. So, we think the reason maybe is count of files or the StreamingAssets size, and as another question from me. there was a lot of .pdb file, (these file size is not big, but too many files). And what we want is just create a assetpack with StreamingAssets. so, from the doc. we just rename the StreamingAsset folder to StreamingAssets.assetpack, this let the steamingAssets a single pack.
    And since that. we found the issue doesn't happen so frequently like before.

    We also found, the reason maybe from google, but even we update the play asset develiry to 1.10.2, this issue also not fixed.
    BUT, even if google PAD make some error like, download error, zip error, IO error, Unity maybe NOT COMPATIBLE the error like "not space ~, unable init". Permission Deny is Permission Deny. IO Exception is IO Exception. No Space is No Space. Please!
     
  42. aleksander_bashkiriev

    aleksander_bashkiriev

    Joined:
    Sep 16, 2020
    Posts:
    3
    Hi!
    We have same problem: errors "Unable to Initialize the Unity Engine" or "not enough storage space to install required resources" on some devices: Redmi 9A, Pixel 3XL, Samsung A52.
    Some times game is started but cant load the some resources. On other devices same build works fine.
    It started when we start use aab.
    We use addressables for resources.
    Any solutions there?

    PS: How can I found issue 1372558 ? I cant found it on issuetracker.unity3d.com if I use search field.
     
  43. domonyiv

    domonyiv

    Joined:
    Oct 1, 2016
    Posts:
    79
    You can vote on this:

    https://issuetracker.unity3d.com/is...ding-app-bundle-with-split-application-binary
     
  44. Ommand

    Ommand

    Joined:
    Apr 29, 2015
    Posts:
    6
    Will the fix be backported to at least 2021.2.x?
     
  45. Rassalom

    Rassalom

    Joined:
    Feb 29, 2016
    Posts:
    17
    @LeonhardP any progress on the issue with "Unable to Initialize the Unity Engine" so far?
     
    lawsonh and Andrewkom like this.
  46. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,143
    Related discussion: https://forum.unity.com/threads/una...-space-to-install-required-resources.1209796/

    Latest reply from the devs:
    Closing this thread to avoid multiple parallel discussions. Please use the thread above going forward.
     
Thread Status:
Not open for further replies.