Search Unity

Question Google play store aab with asset delivery and addressables

Discussion in 'Addressables' started by V-Rangers-Support, Oct 14, 2021.

  1. V-Rangers-Support

    V-Rangers-Support

    Joined:
    Feb 6, 2018
    Posts:
    10
    Hi, I did an app for Android and I use the addressables solution to improve the "fluency" of my app and the load/unloading time for big data.

    Now I have the issue with Google Play store and the requirement to create aab files and my app is larger than 150mb.

    About the addressables :
    - I use the default settings
    - I use only AssetReference m_asset (for inspector)
    - In code I use AssetReference.InstantiateAsync() to load then Addressables.Release() to unload

    I look at Integrate asset delivery (Unity)
    https://developer.android.com/guide/playcore/asset-delivery/integrate-unity?language=api
    But without succes

    So now I don't know what to do !

    I can build an aab less than 150mb but my problem is how can I access to my addressables inside my app.

    Do you have any simple solutions or tips ?
     
  2. al57

    al57

    Joined:
    Feb 13, 2014
    Posts:
    14
    Hi, did you find any solution on this i'm stuck on the same issue.
    I have some video files that i need to seperate from the main aab due to file size limitation and i can't acces the asset bundle..

    Here is the logcat message
    2021/11/08 11:11:44.106 20429 20540 Error Unity Unable to open archive file: /storage/emulated/0/Android/data/com.studio3wg.appbundletest/files/videos

    Below is how i try to get the bundle
    Code (CSharp):
    1.     public void PlayAssetBundleVideo(string videoFile, bool looping, AssetBundle mediabundle)
    2.     {
    3.         //Debug.Log("Loading file " + videoFile);
    4.         // videoPlayer.source = VideoSource.Url;
    5.         videoPlayer.clip = mediabundle.LoadAsset<VideoClip>(videoFile);
    6.         // Debug.Log("videoPlayer.url " + videoPlayer.url);
    7.         videoPlayer.isLooping = false;
    8.         StartCoroutine(PlayVideo());
    9.     }
    And this is the way a try to get the video inside that asset bundle .

    Code (CSharp):
    1.     public void GetBundle()
    2.     {
    3.         if (Application.platform == RuntimePlatform.Android)
    4.         {
    5.            // PlayAssetBundleRequest bundleRequest = PlayAssetDelivery.RetrieveAssetBundleAsync("videos");
    6.             MediasBundle = AssetBundle.LoadFromFile(Path.Combine(Application.persistentDataPath, "videos"));
    7.  
    8.         }
    9.         else
    10.         {
    11.             MediasBundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "videos"));
    12.  
    13.         }
    14.     }
     
  3. RodrigoAbreu

    RodrigoAbreu

    Joined:
    Jan 29, 2013
    Posts:
    12
    Are you guys taking the AssetPack in consideration?
    And also have you guys actually created and 'released' the app in test mode through google play to get to test all the features properly?
    There is also some good information here https://docs.unity3d.com/Manual/play-asset-delivery.html, I'm reading it now to try to learn a bit more before having the full feature working in the game.
     
  4. V-Rangers-Support

    V-Rangers-Support

    Joined:
    Feb 6, 2018
    Posts:
    10
    Hi,

    Here is my solution that works only for the delevry mode "install-time" so all the datas are downloaded when you download the app on Google Play.

    I don't need to change my code and I don't need to add new plugins (like Play Asset Delivery from Google).

    Just need to enable these settings :

    To configure Unity to build Android App Bundles:

    1. Open Build Settings (menu: File > Build Settings).
    2. In Platform, select Android.
    3. If Export Project is enabled, enable Export for App Bundle. Otherwise, enable Build App Bundle (Google Play).
    To configure Unity to split the application binary:

    1. Open Player Settings (menu: Edit > Project Settings then select Player).
    2. Select the Android settings tab and open the Publishing Settings section.
    3. Enable Split Application Binary.

    Then at the end of the build, some warning popup appear and you have to accept all



    Now your aab is ready and you can upload it to google play console
    The aab has all the files for the app and all the big data (known as obb)