Search Unity

Question Play asset delivery

Discussion in 'Android' started by Ellukitas_123, Apr 13, 2021.

  1. Ellukitas_123

    Ellukitas_123

    Joined:
    Jan 20, 2021
    Posts:
    21
    Hi,
    I want to use play asset delivery, but the documentation is not very clear,
    And when I build the project the size of the app bundle increases a lot.

    can someone help me how to use please?
     
    anycolourulike likes this.
  2. pp_dd

    pp_dd

    Joined:
    Feb 7, 2019
    Posts:
    52
    I got the same problem, beside about 50 other problems, that came with this google asset delivery crap.
    There isn't any good documentation yet... Nothing works at all.
    The aab builds don't even start (only black screen and then instant app crash)
    And in about two weeks we are forced to use this bullsh** because obb will no longer be supported.
     
    Fluttershy28 and anycolourulike like this.
  3. Clavus

    Clavus

    Joined:
    Jun 6, 2014
    Posts:
    62
    I was in the same boat and at some point I found that Google pushed out a new set of Unity plugins here: https://github.com/google/play-unity-plugins

    In the Asset Delivery plugin settings you can check "Separate Base APK Asset" which describes itself as an alternative to OBB generation (but still builds everything into a single abb).

    However after submitting the App Bundle generated by that to the Play Store, all our testers crash upon trying to launch the game because of this bug https://github.com/google/play-unity-plugins/issues/127

    So yeah, things aren't going great in this transition and I'd wish that Unity provided more support on this.

    EDIT: there's a fix for the crash described in https://github.com/google/play-unity-plugins/issues/127, should show up in the first post-1.5.0 release but you can apply it manually for now.
     
    Last edited: Aug 13, 2021
    anycolourulike and pp_dd like this.
  4. pp_dd

    pp_dd

    Joined:
    Feb 7, 2019
    Posts:
    52
    Exactly the same error I have…
    As soon as I check „Separate Base APK Asset“ the app won‘t start and gives me the same million errors via adb.
    And when you don‘t check it, the app works normally but you can‘t upload because it‘s more than 150mb…
    I don‘t see any sense in this….
     
    anycolourulike likes this.
  5. pp_dd

    pp_dd

    Joined:
    Feb 7, 2019
    Posts:
    52
    I tried the following and it seems to work so far:
    Install unity beta 2021.2.04b.3123.
    DON'T install that google plugin.
    In build settings check "Build App Bundle (Google Play)
    In publishing settings check "Split Application Binary" (which wasn't there in all previous unity versions I had)
    Then build or build and run.
    I was able to upload that aab to play console without any problems yet and my testers and me were able to launch the installed app so far.
    Seems that the problem was with the other unity versions and that google plugin...
    Now I hope that the beta is stable.

    Hope this helps and continues to work....
    Jesus Christ... what a mess
     
    Sancejas likes this.
  6. Clavus

    Clavus

    Joined:
    Jun 6, 2014
    Posts:
    62
    I see this is a new feature in the 2021.2 beta
    upload_2021-7-21_13-25-26.png

    Hope they back-port this to 2020.3 LTS as soon as possible.
     
  7. pp_dd

    pp_dd

    Joined:
    Feb 7, 2019
    Posts:
    52
    "2021.2.0b4 should be the first version which will have it. We are planing to have a solution in 2019LTS, 2020LTS and 2021.1 by the end of this month."

    Thats what someone from unity told in another post a few days ago
     
  8. LandonC

    LandonC

    Joined:
    Dec 20, 2012
    Posts:
    83
    My game uses OBB, the obb is larger than 150MB... and the game is build with Unity 2018.4, the last time I switched from 2016 to 2018, the whole game needed to be reworked on many aspects, code and animation, everything... Really need some help here guys, is it possible to still use Unity 2018.4 to work with Play Asset Delivery?

    Based on my understanding here and here. We have to use Gradle version 6.1.1 which apparently none of the unity versions support. In the docs, it is mentioned:

    Does it mean 2018.4 can work with the same method used on 2019.4?
     
    Last edited: Jul 24, 2021
  9. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    The Google Play requirement to publish AAB instead of APK is for new apps only. Updates to existing apps can still be published as APKs https://android-developers.googleblog.com/2020/11/new-android-app-bundle-and-target-api.html
    No, this feature was not backported to 2018LTS. 2018LTS support has already ended (see https://forum.unity.com/threads/unity-lts-release-announcements.529171/page-3#post-7249982 ).
     
  10. Sancejas

    Sancejas

    Joined:
    Jul 12, 2019
    Posts:
    3
    [QUOTE = "pp_dd, post: 7348244, membro: 2666986"] Tentei o seguinte e parece funcionar até agora:
    Instale a unidade beta 2021.2.04b.3123.
    NÃO instale esse plugin do Google.
    Nas configurações de compilação, marque "Build App Bundle (Google Play)
    Nas configurações de publicação, marque "Split Application Binary" (que não existia em todas as versões anteriores que eu tinha)
    Em seguida, construa ou construa e execute.
    Eu consegui carregar aquele aab para jogar console sem problemas ainda e meus testadores e eu conseguimos iniciar o aplicativo instalado até agora.
    Parece que o problema era com as outras versões do Unity e aquele plugin do Google ...
    Agora espero que o beta esteja estável.

    Espero que isso ajude e continue a funcionar ....
    Jesus Cristo ... que bagunça [/ QUOTE]


    infelizmente ainda assim, foi ótimo que finalmente adicionaram esta opção junto com o .aab, meu .aab ainda é maior que 150mb, aparentemente não é mais necessário apenas a primeira cena para fazer o binário, e colocar o resto em outro arquivo.
     
  11. kimmo1

    kimmo1

    Joined:
    Feb 7, 2014
    Posts:
    49
    I cant get my newest unity 2019 to split aab file. Even i updated gradle 6.1.1... Split application binary is checked.
     
  12. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    What error do you get?
     
  13. kimmo1

    kimmo1

    Joined:
    Feb 7, 2014
    Posts:
    49
    I dont get any error. It just makes 1 big file about 558mb. If i try to upload it to play store it gives me error file is too big..
    Splitting apk file works ok.
     
  14. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Which exact Unity version do you use? Do you get any warnings when compiling the project?
     
  15. kimmo1

    kimmo1

    Joined:
    Feb 7, 2014
    Posts:
    49
    unity 2019.4.29f. warning:The size of core Unity asset packs went over the maximum asset pack size allowed by the Google Play Store. Most likely the app upload to the Play Store will fail. You should try to reduce the size of your assets or move some of them into the custom asset pack. Unity is packing 1394MB of core data assets into the 'install-time' delivery type asset pack. Play Store has a 1024MB size limit for install-time asset pack and 512MB size limit for fast-follow asset pack. See https://developer.android.com/guide/playcore/asset-delivery#download-size-limits for more details.

    So i have to manually create folder and move some assets there? i thought it will be automatically like with APK
     
  16. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Yes, you will have to adapt your project. Take a look at https://docs.unity3d.com/2019.4/Documentation/Manual/play-asset-delivery.html for more information on what Unity can do automatically.
    For APK + OBB there was only a 2GB limit for OBB file, however with Play Asset Delivery there are much more limits, so unfortunately Unity is not able to split up everything automatically in your project.
     
  17. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Hi @JuliusM Is there any toggle true/false API that I can call to build apk that will pack in PAD format at Unity 2020.3.15? If not can u provide one in next Unity 2020.3.x? My use case is I want to create a custom build menu to do that instead of using regular default build setting.
     
    Last edited: Aug 13, 2021
  18. kadirozyy

    kadirozyy

    Joined:
    Jun 15, 2020
    Posts:
    1
    Changing system language to English fixed my build&run error.
     
    Last edited: Aug 13, 2021
  19. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    There is no new API for that, but the existing APIs should be sufficient.
    First, you need to set PlayerSettings.Android.useAPKExpansionFiles to true, which will enable "Split App Binary" option in Player Settings. Then, to build AAB file instead of APK, you can set EditorUserBuildSettings.buildAppBundle to true, which will enable "Build App Bundle" option in Build Settings.
     
  20. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    @JuliusM Ya. I know that 2 APIs. The new API that I actually want is build PAD compatible APK. Currently only support build PAD compatible AAB.
     
  21. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    There is no way to create APK directly. You have to build AAB first and then convert it into apks using the bundletool. The command is
    Code (CSharp):
    1. bundletool build-apks --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks
    The bundletool is installed together with Android player in your Unity install directory at PlaybackEngines/AndroidPlayer/Tools. We don't plan to add specific options or APIs for this task, however you can easily do it yourself by invoking that command after the aab is built.
     
  22. Teomani

    Teomani

    Joined:
    Dec 12, 2016
    Posts:
    7
    I'm porting a PC game to Android, the game logic does not use asset bundles, but addressable, and my question is.

    Do I have to change the logic of the game and script so that it uses the asset bundles? Do I have to account for any changes at in all in scripts to use the new PAD system?
     
  23. Teomani

    Teomani

    Joined:
    Dec 12, 2016
    Posts:
    7
    A small addendum...

    When I say changes I mean everything else that's not downloading the asset delivery plugin, making bundles and setting them for install-time or fast-follow.
     
  24. Razera

    Razera

    Joined:
    Oct 5, 2015
    Posts:
    5
    Hi! I'm having the same problem but I found a tutorial that helped me and you can check it here.

    But I'm still having error while trying to build my game, I created a thread to see if anyone could help me with this but nothing yet.
     
    Teomani likes this.
  25. MassiveHeadGames

    MassiveHeadGames

    Joined:
    Jun 5, 2021
    Posts:
    24
    I have a completed multiplayer game that I ported to Android and all preliminary test builds work fantastically. It's only ~260Mb. The game does not use assetbundles. We are using U2019.4

    So I read the new Google Play PAD standard and I am not sure what to do. Seems like I am now forced to use assetbundles? I don't want to wreck the game structure just for Android because I am also going to port it to Apple Store and I want to keep maintenance down - as much as possible. Maybe it's a bridge too far. Idk.

    From what I am gathering is that if you have a completed game that works great on PC and even works on Android test builds outside of Google Play, that in order for it to be uploaded and work on Google Play, you must now use PAD, and in order to use PAD, you must now wreck your current working game structure, rewrite some code for play asset delivery, and break the game into assetbundles? Is that correct? There's no other way?
     
    Last edited: Oct 24, 2021
  26. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,900
    You don't need to use asset bundles, you simply need to export app bundle instead of apk, no changes in your game code should be necessary. More information here - https://docs.unity3d.com/Manual/play-asset-delivery.html
     
  27. MassiveHeadGames

    MassiveHeadGames

    Joined:
    Jun 5, 2021
    Posts:
    24
    Thanks for the quick reply. I've read that document multiple times. If what you say is true then I am confused by this part...

    "Using Play Asset Delivery
    To use Play Asset Delivery, you need to set up your project to build Android App Bundles and split the application binary."

    Is that doc offering "potentially" different ways of doing things? If so, it's not clear to new comers of the Google Play 150M apocalypse. I was reading it somewhat like instructional steps a, b, c. Still find it confusing. And it doesn't mention that the "correct" split binary feature was added in 2019.4.29. I just happened to find that info just before I checked on your reply to me...

    from JuliusM (Unity Tech) about splitting the app binary

    Here's his reply to another dev asking about it: "You've said you are using Unity 2019.2.8f1. This feature is not available in that version. The feature was added in 2019.4.29f1, so you will have to use this or newer Unity version. Also make sure to take a look at Gradle requirements for this https://docs.unity3d.com/2019.4/Documentation/Manual/play-asset-delivery.html"

    Turns out I was using 2019.4.28f1. One slight version below the one with the newly available split app binary feature. Now I know why some other instructions I initially tried to follow made no sense - I could not find the feature.

    [UPDATE] I finally figured out that Unity's method of splitting the apk works for most situations but in my situation the way I structured my project made the base loader after the split too large which caused Google Play console to reject it. I got around this by creating an empty boot loader that immediately calls my main launcher scene. This dropped the base loader file size significantly and it was finally accepted. Later I may restructure the project to use asset bundles and the Play Asset Delivery method to accommodate new asset updates.
     
    Last edited: Nov 11, 2021
  28. pengyj0502

    pengyj0502

    Joined:
    Nov 5, 2021
    Posts:
    5
    HI all, I'm following the document "https://docs.unity3d.com/2019.4/Documentation/Manual/play-asset-delivery.html" making an aab file. If I disable Split Application Binary option, the size of aab file is about 300MB, otherwise the size is about 60MB. It looks good for now. My question is if I enable Split Application Binary option, where is the "Generated asset packs"?
    In another project I'm working on, we use addressable to handle resources. If I unzip the aab file, all the asset packs are in the file.
    So I thought the generated asset packs should be in somewhere too. But I can't find them.
    @JuliusM @Tomas1856
     
  29. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Do you have custom gradle templates in your project? You will have to recreate them based on the default templates in the currently used Unity version.
    Most likely you are missing **PLAY_ASSET_PACKS** entry in the launcher gradle template, but there could be other things as well, so the safest thing to do is to backup your gradle templates by moving them somewhere outside of the project, allow Unity editor to recreate them based on default templates and then redo your custom modifications.
     
  30. pengyj0502

    pengyj0502

    Joined:
    Nov 5, 2021
    Posts:
    5
    It works. Thanks a lot for your reply.
     
  31. pengyj0502

    pengyj0502

    Joined:
    Nov 5, 2021
    Posts:
    5
    Hi Julius, here is another problem.
    I uploaded the aab file to google play, then downloaded the apk file. But the program stopped when I called
    SceneManager.LoadScene(1);
    Is there anything I should have done before using the assets in the asset pack?
     
  32. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Hi, it's hard to know what is the problem without seeing the log. If asset packs are present in the AAB, then maybe they were not yet downloaded by the time you called LoadScene. Take a look at this documentation page https://docs.unity3d.com/Manual/play-asset-delivery.html it explains that if your assets get placed in the fast-follow delivered asset pack, then they might not be available right away. You can use AndroidAssetPacks.coreUnityAssetPacksDownloaded API to check if Unity created asset packs were downloaded before you load the scene.
     
  33. pengyj0502

    pengyj0502

    Joined:
    Nov 5, 2021
    Posts:
    5
    Hi, I have done some other tests. It seems like all the assets in the packs, include Resources and scenes are not loaded. I did not have any custom pack. Also I can not see any error occurs in logcat. If I use loadSceneAsync, the program will not stop, but I can not get into the target scene either.
     
  34. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Please submit a bug report. We will have to investigate this to know what is going on.
     
  35. pengyj0502

    pengyj0502

    Joined:
    Nov 5, 2021
    Posts:
    5
    Hi, good news. I upgraded my unity editor from 2019.4.29 to 2019.4.34, and the problem solved.
     
  36. Alinauman

    Alinauman

    Joined:
    Aug 14, 2020
    Posts:
    2

    so what is your game size sir. I have been trying to upload my game
     
  37. exsurgo_ankit

    exsurgo_ankit

    Joined:
    Feb 5, 2020
    Posts:
    29
    Hello,

    Joining in on this thread now in March 2022. It took quite some time to get the project setup with the google play package, and finally build an .aab that was accepted by google play. The aab size is 240 MB but the "Signed, universal APK" size is 680 MB. I have built using IL2CPP backend for Armv64 and Armv7.
    I am running unity version 2018.4.35f1.
    I published the app for internal testing and it works but the download size is almost 3 times the size of .aab.
    I tried changing the asset bundle delivery from "install time" to "fast follow" which reduced the google download size by 80 MB, but it still too large.

    Does anyone know whether this is a unity issue or google play issue?
    I thought the whole point of .aab was to reduce the initial install size and time and then download the required assets in the background.

    When I look at the delivery tab on app bundle in google play, I see these numbers which do not add up to 700 MB.
    Feature modules
    Name Delivery conditions Download size
    base Install time 21.4 MB

    Asset packs
    Name Delivery conditions Download size
    base_assets Install time 141 MB
    sceneassetbundle Fast follow 55.4 MB
    textureassetbundle Fast follow 110 KB
     
  38. FlyVC

    FlyVC

    Joined:
    Jan 5, 2020
    Posts:
    30
    I have an issue with the AssetPackConfiguration:

    When I add the folder where I copied all the Assetbundle files that the Addressable Build script created, I get an error message: "This folder is missing an AssetBundle file that matches the folder name"

    folder missing assetbundle.jpg

    I already tried several variations with diffrent build paths and assetbundle settings, does anyone have an idea?
     
  39. FlyVC

    FlyVC

    Joined:
    Jan 5, 2020
    Posts:
    30
    we found the problem in this thread:
    https://github.com/jelte/be.khepri.play.assetdelivery.addressables/discussions/57

    The package "Play Asset Delivery - Addressables" seems currently not working with the newest Addressables Package Version 1.19.19, after downgrading it to 1.18.19 it worked again
     
  40. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    I have a question, i read the thread but i cannot understand about apple store, we can use play asset delivery for play store and upload the complete binary for apple store?
     
  41. hoyoyo80

    hoyoyo80

    Joined:
    Jan 31, 2018
    Posts:
    58
    Hi all, after a long thread i still cannot draw any solid workflow...i too have a problem,my workflow is using google plugin
    1. In build in only select the first scene(start menu), uncheck the other scene and i flag it with assetbundle name and the i build the assetbundle
    2. I choose install-time in google plugin
    3. Setup other basic essential for android(keystore, android version etc etc)
    4. Build the android aab
    I successfully upload to playstore for internal testing but it can only play the first scene(start menu) and dont load the next scene.
    Question: 1. Do i need any script or anything,changing game code to use the assetbundle that contain other scene?
    2. Dumb question, i would love to test the aab reliability w/o uploading to playstore. Any method to learn?
    Thanks