Search Unity

Hosting Plugin to load Addressables from Firebase Storage

Discussion in 'Addressables' started by robinryf, Sep 29, 2019.

  1. elfasito

    elfasito

    Joined:
    Jul 4, 2017
    Posts:
    51
    Hey robin.
    I have a problem in offline mode, if is offline the app uses the catalog generated with the build app. "(com.unity.addressables\aa\Android\catalog.json)"
    So, in offline mode I get a different bundle version than in online mode.
    I solved this problem editing manually the settings.json before build the app.
    I change this:
    Code (CSharp):
    1. "m_Keys":["AddressablesMainContentCatalog"],"m_InternalId":"{[B]UnityEngine.AddressableAssets.Addressables.RuntimePath}/catalog.json[/B]"
    to this:
    Code (CSharp):
    1. {"m_Keys":["AddressablesMainContentCatalog"],"m_InternalId":"{UnityEngine.Application.persistentDataPath}/com.unity.addressables/catalog_1.json"
    In this path I store the updated catalog from remote, so in offline mode I can access to it too.

    is there a way of set this new path in some addressable menu settings in unity inspector?
     
    Last edited: Oct 28, 2020
  2. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
  3. mariorago

    mariorago

    Joined:
    May 17, 2020
    Posts:
    2
    Hello there, i am trying to make this plugin work but somehow i cant , can someone give me some advice?

    I did all the steps on the tutorial of the plugin, on editor it works when i hit play but when i make a build on windows it throws this

    Could not get url for: gs://.../test/StandaloneWindows64/testgroup_assets_all.bundle, System.AggregateException: One or more errors occurred. ---> Firebase.Storage.StorageException: Permission denied. Could not perform this operation Http Code: 403
    --- End of inner exception stack trace ---
    ---> (Inner Exception #0) Firebase.Storage.StorageException: Permission denied. Could not perform this operation Http Code: 403<---

    Im just calling a cube , with the object reference

    i put the init scrip on an object, im using unity 2019.4 and Addressables 1.8.5

    on the script i called as this

    void Awake()
    {
    FirebaseAddressablesManager.FirebaseSetupFinished += LoadScene;

    }

    private void LoadScene()
    {
    cubeRef.InstantiateAsync();
    }
    and then on the build log it throws the error i put before, i need to make this work on firebase because of the project, and if someone could give me some advice id be grateful

    thanks in advance!
     
  4. elfasito

    elfasito

    Joined:
    Jul 4, 2017
    Posts:
    51
    you have some specific rules in firebase storage?.
    maybe your rules be are rejecting the requests.
     
    mariorago likes this.
  5. mariorago

    mariorago

    Joined:
    May 17, 2020
    Posts:
    2
    OMG I never notice this, searched a bit about the rules that were on and it were rejecting all the request, i was about to collapse, thanks for this!
     
    elfasito likes this.
  6. shrinebot

    shrinebot

    Joined:
    Sep 12, 2014
    Posts:
    16
    Hi all,

    First, great API thanks for providing it. I have everything working in my project, everything except, caching assetbundles locally.

    Note, they do 'work' correctly for a session, ie everything downloads from firebase and loads within unity correctly, its just when a player removes the app from memory they have to re-download all the assetbundles everytime.

    Note: I can get the catalog.json and catalog.hash to cache correctly, just that for whatever reason the assetbundles wont. Ive tried different variations with the Asset Provider and AssetBundle Provider settings on each Addressable group to no avail.

    Any help on even pointing me in the right direction would be great?

    Cheers
     
  7. shrinebot

    shrinebot

    Joined:
    Sep 12, 2014
    Posts:
    16
    i190445 and robinryf like this.
  8. javierfed

    javierfed

    Joined:
    Apr 10, 2015
    Posts:
    50
    Hey all. Robin, I have a question which may be encountered by others.

    How can we handle exceptions dealing with returned errors from the request call? It may be something out of the scope of this project but lets say all this is integrated and it works fine as long as someone is signed in, as intended...
    how do we capture exceptions from when the user is not logged in?

    I get exceptions thrown in unity like
    Code (csharp):
    1.  Could not load hash: System.AggregateException: One or more errors occurred. ---> Firebase.Storage.StorageException: Permission denied. Could not perform this operation  Http Code: 403
    2.    --- End of inner exception stack trace ---
    3. ---> (Inner Exception #0) Firebase.Storage.StorageException: Permission denied. Could not perform this operation  Http Code: 403<---
     
  9. javierfed

    javierfed

    Joined:
    Apr 10, 2015
    Posts:
    50
    hey all,
    I have assets being loaded via Addressables.LoadAssetsAsync, which works fine for the fastest play mode (use asset database) but hangs when using Simulated Groups. by hang I mean that the async operation starts, but never completes. the isDone property stays false and never goes true.

    Any one have ideas how I can begin to debug this?

    (Edit) I discovered it wasn't hanging, but was progressing EXTREMELY SLOWLY, does anyone know what could be causing this?
     
    Last edited: Jan 23, 2021
  10. robinryf

    robinryf

    Joined:
    May 22, 2014
    Posts:
    54
    Hi javierfed,
    Normally you should be able to subscribe to UnityEngine.ResourceManagement.ResourceManager.ExceptionHandler and then dig down to the actual server exception using exception.InnerException
    I hope that works for you

    hmm, to be honest I never use the simulated mode.. Either I go fast in editor loading or I want the close to real pre-build bundles expierience.
    I guess you could set a breakpoint and checkout why the UnityWebRequest that loads your bundle is so slow.. But I would not even know how to call a WebRequest slowly.. :D
    I think the simulated approach is not really supported by me, sorry.. I am open for MergeRequests if you want to add it.

    Just curious.. why do you want to use the simulated mode?

    Cheers,
    Robin
     
  11. robinryf

    robinryf

    Joined:
    May 22, 2014
    Posts:
    54
    @Paul_H23
    That seems like a good idea. You would then just have to make sure to invalidate the manifest on disk. But the same happens with the cached bundle locations. Did you alter the code to make it work? :D
     
  12. robinryf

    robinryf

    Joined:
    May 22, 2014
    Posts:
    54
    Not that I know off sorry..
     
  13. robinryf

    robinryf

    Joined:
    May 22, 2014
    Posts:
    54
  14. javierfed

    javierfed

    Joined:
    Apr 10, 2015
    Posts:
    50
    this ended up being a symptom of switching between modes, and I agree, simulated is a bit confusing. I try to use it to debug issues that arise from loading. I am stuck on a bug where I get a null reference in the catalog hash when I try to load resources from external source (use Exsisting Build). I was trying to figure out where the issue is to debug. the exception is this.

    Code (CSharp):
    1. Exception encountered in operation Resource<String>(catalog_0.1.hash), status=Failed, result= : Object reference not set to an instance of an object
    2. UnityEngine.ResourceManagement.AsyncOperations.<>c__DisplayClass55_0:<add_CompletedTypeless>b__0(AsyncOperationHandle`1)
    3. DelegateList`1:Invoke(AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.16.15/Runtime/ResourceManager/Util/DelegateList.cs:69)
    4. UnityEngine.ResourceManagement.AsyncOperations.InitalizationObjectsOperation:<Execute>b__7_0(AsyncOperationHandle`1)
    5. DelegateList`1:Invoke(AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.16.15/Runtime/ResourceManager/Util/DelegateList.cs:69)
    6. UnityEngine.ResourceManagement.ResourceManager:Update(Single)
    7. MonoBehaviourCallbackHooks:Update() (at Library/PackageCache/com.unity.addressables@1.16.15/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:26)
    my only thoughts are somehow, somewhere there are remanents of references to previous groups I added and have since deleted. but that is farfetched and only the files remain, no tags or groups are there. It is halting my progress and irritating to not know why it is bugging out. I am a professional programmer by gosh.
     
  15. javierfed

    javierfed

    Joined:
    Apr 10, 2015
    Posts:
    50
    yep. sorry, figured out my flaw. I wasn't completing the initialization for the RobinBird system before trying to load assets. now if only I could load one addressable from a different path than another addressable...
     
  16. elfasito

    elfasito

    Joined:
    Jul 4, 2017
    Posts:
    51
  17. robinryf

    robinryf

    Joined:
    May 22, 2014
    Posts:
    54
  18. elfasito

    elfasito

    Joined:
    Jul 4, 2017
    Posts:
    51
    @
    Hello Robin, I tried to add the link to the manifest, but get Error.
    Just for clarify, I want to add the offline-handling branch to the project manifest, no download the zip from the webpage.
    PD: I never used git

    tried:
    *"robinbird.firebasetools": "https://gitlab.com/robinbird-studios/libraries/unity-plugins/firebase-tools.git#offiline-handling"

    *"robinbird.firebasetools": "https://gitlab.com/robinbird-studio...rebase-tools/-/tree/tech/offline-handling.git"
     
    Last edited: Jun 5, 2021
  19. Cery_

    Cery_

    Joined:
    Aug 17, 2012
    Posts:
    48
    This worked for me:
    Code (CSharp):
    1. "robinbird.firebasetools": "git+https://gitlab.com/robinbird-studios/libraries/unity-plugins/firebase-tools.git#tech/offline-handling",
     
    elfasito likes this.
  20. GastonC

    GastonC

    Joined:
    Aug 26, 2012
    Posts:
    38
    First of all, @robinryf great package to help us with Firebase!

    I have it working (sort of), but have a question.
    When I build my app, a popup asks me if I want to build Addressables (this is from Unity). This is not using your build script correct?
    1. Can I do anything to modify this? or should I first build the addressables with your script, and then the build (and put no on the popup?).
    2. How do I use your build script, for a content update? doesn't seem to be working
     
  21. robinryf

    robinryf

    Joined:
    May 22, 2014
    Posts:
    54
    Thanks, I hope it helps!

    1. Hmm, AFAIK Addressables does not come out of the box with such a popup. Maybe you can try searching your code globally for the text of the popup. I recall writing an Editor Extension to ask the dev if Addressables should be built. But I think I didn't include it in this Firebase Tools package.
    You would have to call the right Firebase Build method from your own automated build script. Or call the right method manually if you are building through the Editor Interface. If Addressables does have such a popup, I'm pretty sure that would not use the right build method if you are keeping your Addressable catalog on Firebase too. Check this link if you are unsure what I mean by catalog on Firebase: https://gitlab.com/robinbird-studio.../Addressables#configure-build-script-optional

    2. I don't have a game that uses content update.. So it is not tested, sorry. I am more than happy for an contribution if you can figure it out. Technically it should work since this extension "only" changes the way Addressables receives the Bundles. Everything from there is done through the normal Addressable way. So the right assets should be loaded from either the local, downloaded or content update bundles.


    Cheers
    Robin
     
    unity_IpxdANggCs1roQ likes this.
  22. Kurogami_Ryujin

    Kurogami_Ryujin

    Joined:
    Apr 7, 2018
    Posts:
    4
    Hello,

    I haven't been able to make it work on my Addressables test project. I followed the README, though the images aren't the same for Unity version 2020.3.26f1. I'm getting these errors when I run Simulated Groups mode in the editor:
    1.
    Could not get url for: gs://addressables-test-7e4f4.appspot.com/Android/26a217df9f93ee27148cbc0616c3008a_scenes_all_161a4acb-5cba-45ac-adf3-2ca9c6aa0087.bundle, System.AggregateException: One or more errors occurred. ---> Firebase.Storage.StorageException: Not Found. Http Code: 404
    --- End of inner exception stack trace ---
    ---> (Inner Exception #0) Firebase.Storage.StorageException: Not Found. Http Code: 404<---
    2.
    OperationException : Provider of type RobinBird.FirebaseTools.Storage.Addressables.FirebaseStorageAssetBundleProvider with id RobinBird.FirebaseTools.Storage.Addressables.FirebaseStorageAssetBundleProvider has provided a result of type RobinBird.FirebaseTools.Storage.Addressables.FirebaseStorageAssetBundleProvider which cannot be converted to requested type UnityEngine.ResourceManagement.ResourceProviders.IAssetBundleResource. The operation will be marked as failed.

    Group settings are:
    upload_2022-2-28_12-31-18.png

    I also make use of the Firebase builder and is set in the Addressables settings:
    upload_2022-2-28_12-32-22.png

    I have the initialize script in the first scene. I'll put it here just in case:
    Code (CSharp):
    1. using System.Collections.Generic;
    2. using System.IO;
    3. using Firebase.Extensions;
    4. using RobinBird.FirebaseTools.Storage.Addressables;
    5. using UnityEngine;
    6. using UnityEngine.AddressableAssets;
    7. using UnityEngine.ResourceManagement.AsyncOperations;
    8. using UnityEngine.ResourceManagement.ResourceProviders;
    9.  
    10. public class InitFirebaseStorage : MonoBehaviour
    11. {
    12.     void Awake()
    13.     {
    14.         Debug.Log($"Current cache: {Caching.defaultCache.path}");
    15.        
    16.         var cachePaths = new List<string>();
    17.         Caching.GetAllCachePaths(cachePaths);
    18.         foreach (var cachePath in cachePaths)
    19.         {
    20.             Debug.Log($"Cache path: {cachePath}");
    21.         }
    22.        
    23.  
    24.         //Caching.ClearCache();
    25.        
    26.         Addressables.ResourceManager.ResourceProviders.Add(new FirebaseStorageAssetBundleProvider());
    27.         Addressables.ResourceManager.ResourceProviders.Add(new FirebaseStorageJsonAssetProvider());
    28.         Addressables.ResourceManager.ResourceProviders.Add(new FirebaseStorageHashProvider());
    29.  
    30.         Addressables.InternalIdTransformFunc += FirebaseAddressablesCache.IdTransformFunc;
    31.  
    32.         Debug.Log("Getting download size");
    33.         const string downloadAssetKey = "Assets/Scenes/DownloadSizeScene.unity";
    34.         FirebaseAddressablesCache.PreWarmDependencies(downloadAssetKey,
    35.             () =>
    36.             {
    37.                 var handler = Addressables.GetDownloadSizeAsync(downloadAssetKey);
    38.                
    39.                 handler.Completed += handle =>
    40.                 {
    41.                     if (handle.Status == AsyncOperationStatus.Failed)
    42.                     {
    43.                         Debug.LogError($"Get Download size failed because of error: {handle.OperationException}");
    44.                     }
    45.                     else
    46.                     {
    47.                         Debug.Log($"Got download size of: {handle.Result}");
    48.                     }
    49.                
    50.                     Addressables.DownloadDependenciesAsync(downloadAssetKey).Completed +=
    51.                         operationHandle =>
    52.                         {
    53.                             var dependencyList = (List<IAssetBundleResource>)operationHandle.Result;
    54.                             foreach (IAssetBundleResource resource in dependencyList)
    55.                             {
    56.                                 AssetBundle assetBundle = resource.GetAssetBundle();
    57.                                 Debug.Log($"Downloaded dependency: {assetBundle}");
    58.                             }
    59.                         };
    60.                 };
    61.             });
    62.  
    63.         // Make sure to continue on MAIN THREAD for addressables initialization
    64.         Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task => {
    65.             var dependencyStatus = task.Result;
    66.             if (dependencyStatus == Firebase.DependencyStatus.Available) {
    67.                 // Create and hold a reference to your FirebaseApp,
    68.                 // where app is a Firebase.FirebaseApp property of your application class.
    69.                 //   app = Firebase.FirebaseApp.DefaultInstance;
    70.  
    71.                 Debug.Log("FIREBASE INIT FINISHED");
    72.                 FirebaseAddressablesManager.IsFirebaseSetupFinished = true;
    73.  
    74.                 // Set a flag here to indicate whether Firebase is ready to use by your app.
    75.             } else {
    76.                 UnityEngine.Debug.LogError(System.String.Format(
    77.                     "Could not resolve all Firebase dependencies: {0}", dependencyStatus));
    78.                 // Firebase Unity SDK is not safe to use here.
    79.             }
    80.         });
    81.  
    82.        
    83.     }
    84. }
    85.  
    Basically, all the project does is load 3 almost empty scenes (addressables enabled) with the first and third one having an object that can manually spawn a prefab (which is also an addressable prefab). I can only try it in simulated groups mode due to Unity crashing when I try builds mode. This happens when I hit start in the main menu and initiate the call to load the first scene. The loading progress happens for a bit (it actually goes up like it's working) before the crash happens, though that could just be the asynchronous operation working until it encounters the problem with the URL.

    When I tried simulated groups mode to debug, that error above pops up. The scene still loads, but when I try to spawn the test prefab (which is an empty gameobject with a cube for a child), the same 404 error above pops up but with its respective URL. The prefab doesn't spawn.

    I've also tried building an APK and running it on my Android phone and the scene loading doesn't even load (progress stuck at 0%).

    Not sure if I've put enough info for troubleshooting, but I hope it helps identifying where I'm going wrong.
     

    Attached Files:

  23. ccarry

    ccarry

    Joined:
    Feb 28, 2022
    Posts:
    1
    Seems to work! Thanks Robin.
     
    robinryf likes this.
  24. robinryf

    robinryf

    Joined:
    May 22, 2014
    Posts:
    54

    Thanks for the detailed report. Seems strange... Sorry for the error. Did you check if the file is actually uploaded to Firebase Storage at "gs://addressables-test-7e4f4.appspot.com/Android/26a217df9f93ee27148cbc0616c3008a_scenes_all_161a4acb-5cba-45ac-adf3-2ca9c6aa0087.bundle". I have had it often that the hashes mismatched because I had some old bundles on the server and I didn't notice.
    Please check and if it is uploaded we can dive deeper into the issue!


    Cheers,

    Robin
     
  25. Kurogami_Ryujin

    Kurogami_Ryujin

    Joined:
    Apr 7, 2018
    Posts:
    4
    I always clear Firebase Storage whenever I make a new build, so it's always clean. Basically, I got to Firebase Storage, go to gs://[project_name].appspot.com/Android, select all, then delete. Then, I upload the new build from ServerData/Android.

    Additionally on my most recent run, I checked the link the game was pulling the bundles from:
    gs://addressables-test-7e4f4.appspot.com/Android/56606010d034a635e1b574b512905812_assets_all_7a0ebb2f-156d-404c-8068-e88cf1261ece.bundle
    and found that this does not work when I use it on an internet browser. For this run, I just had a single Addressable Group be loaded remotely, which is the characters consisting of a cube and Unity-chan's unanimated 3D model.

    When I go to Firebase Storage and use the link for the asset provided on the right panel, which is:
    https://firebasestorage.googleapis....ia&token=aec1b686-7c9f-467c-a7c1-c65d45541558,
    it will initiate a download. If I remove the part after the question mark like:
    https://firebasestorage.googleapis....s_all_68be1ac65eacf483b3b319cb2b5ce46a.bundle,
    it displays the JSON format of what I presume to be the bundle's data.

    Could it be that the link being used is actually incorrect?
     
  26. robinryf

    robinryf

    Joined:
    May 22, 2014
    Posts:
    54
    Sounds good

    It seems that the Url conversion is not working.

    The process if roughly like this:

    1. Asset Load is requested
    2. Asset Path is looked up in the manifest to get the remote url ( gs://addressables-test-7e4f4.appspot.com/Android/26a217df9f93ee27148cbc0616c3008a_scenes_all_161a4acb-5cba-45ac-adf3-2ca9c6aa0087.bundle )
    3. We ask Firebase Storage API to give us the actual download URL (HTTP link) for the file
    4. We pass the HTTP url to Addressables so it can download it normally.

    In step 3 we seem to have a problem.

    My first attempt would be to isolate the problem. After Firebase has Initialized you could add a UI button or something to execute a brute forced code like this:

    Code (CSharp):
    1. var reference = FirebaseStorage.DefaultInstance.GetReferenceFromUrl("gs://addressables-test-7e4f4.appspot.com/Android/26a217df9f93ee27148cbc0616c3008a_scenes_all_161a4acb-5cba-45ac-adf3-2ca9c6aa0087.bundle");
    2.  
    3.             reference.GetDownloadUrlAsync().ContinueWithOnMainThread(task =>
    4.             {
    5.                 if (task.IsCanceled || task.IsFaulted)
    6.                 {
    7.                     Debug.LogError($"Could not get url: {task.Exception}");
    8.                     return;
    9.                 }
    10.  
    11.                 string url = task.Result.ToString();
    12.                 Debug.Log($"We got url: {url}");
    13. }
    If that code fails we already have a problem that Firebase can't resolve the gs:// url to a http:// one. Check your Firebase settings. The Firebase Storage rules and the configuration files if they actually point to the right Firebase Project.

    If it works I would advise to set a breakpoint where the "Could not get url for:" error message is printed in code. Check the urls for any changes and why it works in an isolated case but not in the Addressable resolve case.


    You could also try out the not yet released https://gitlab.com/robinbird-studio...s/firebase-tools/-/tree/tech/offline-handling "offline-handling" branch. I added some logging and bug fixes.
    Make sure to set the Logging level before Initializing in an Awake method:

    Code (CSharp):
    1. FirebaseAddressablesManager.LogLevel = LogLevel.Verbose;
    Good luck

    Cheers
     
  27. EnjeruDarari

    EnjeruDarari

    Joined:
    Jul 6, 2020
    Posts:
    6
    Hi.

    Unity 2020.3.36f1
    Adressables 1.18.19
    Firebase Storage 9.1.0

    When I try to load bundles from the network through a script with an example, I get this error:


    Code (Boo):
    1. OperationException : Provider of type RobinBird.FirebaseTools.Storage.Addressables.FirebaseStorageHashProvider with id RobinBird.FirebaseTools.Storage.Addressables.FirebaseStorageHashProvider_2db20444e4684b14080b7a27fcae5cbb has provided a result of type System.String which cannot be converted to requested type UnityEngine.ResourceManagement.ResourceProviders.IAssetBundleResource. The operation will be marked as failed.
    2.  
    3. UnityEngine.ResourceManagement.ResourceProviders.ProvideHandle:Complete<string> (string,bool,System.Exception)
    4. RobinBird.FirebaseTools.Storage.Addressables.FirebaseStorageHashProvider:<LoadManifest>b__2_1 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<string>) (at Library/PackageCache/robinbird.firebasetools@ac3a1334fe/Storage/Addressables/FirebaseStorageHashProvider.cs:58)
    5. DelegateList`1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<string>>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<string>) (at Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/Util/DelegateList.cs:69)
    6. UnityEngine.AsyncOperation:InvokeCompletionEvent ()
     
  28. elfasito

    elfasito

    Joined:
    Jul 4, 2017
    Posts:
    51
    Hello, is working on addressables 1.20.3?.
    for me its not working, I dont get any error but dont load the assets.
    I downgrade again to 1.19.19. and working nice again.
     
  29. afurioso

    afurioso

    Joined:
    Jan 12, 2022
    Posts:
    88
    Does this plugin work with the latest version of unity for Apple chip? In the documentation, I don't see a lot of voice for group settings

    Screenshot by Lightshot (prnt.sc)
     
    Last edited: Aug 23, 2022
  30. afurioso

    afurioso

    Joined:
    Jan 12, 2022
    Posts:
    88
    @robinryf I don't understand how this can work on the contrary. What I need to do is to retrieve game object from firebase storage to unity. My items are uploaded from the users externally to unity (by a website) and then I want to show that object in the game.

    So how could I do that?

    Thank you!
     
  31. elfasito

    elfasito

    Joined:
    Jul 4, 2017
    Posts:
    51
    hello, I started a clean Addressables config (1.21.10)
    but I cant make this work anymore.
    I enabled the LogLevel.Verbose and I get these errors:
    Code (CSharp):
    1. Transformed gs://XXXX-XX/XXXX/v5/iOS/remote_scenes_assets/scenes/menunovedades.unity_b556af05549787a2bbd6ef86524da93c.bundle to gs://XXXX-XX/XXXX/v5/iOS/remote_scenes_assets/scenes/menunovedades.unity_b556af05549787a2bbd6ef86524da93c.bundle
    Code (CSharp):
    1. Loading from gs://XXXX-XX/XXXX/v5/iOS/remote_scenes_assets/scenes/menunovedades.unity_b556af05549787a2bbd6ef86524da93c.bundle
    looks like the url is not getting transformed from gs:// to https://
    after that I get:
    Code (CSharp):
    1. Could not get url for: gs://XXXX-XX/XXXX/v5/iOS/remote_scenes_assets/scenes/menunovedades.unity_b556af05549787a2bbd6ef86524da93c.bundle, System.AggregateException: One or more errors occurred. ---> Firebase.Storage.StorageException: Object does not exist at location.
    2.    --- End of inner exception stack trace ---
    3. ---> (Inner Exception #0) Firebase.Storage.StorageException: Object does not exist at location.<---
    Code (CSharp):
    1. OperationException : Provider of type RobinBird.FirebaseTools.Storage.Addressables.FirebaseStorageAssetBundleProvider with id RobinBird.FirebaseTools.Storage.Addressables.FirebaseStorageAssetBundleProvider has provided a result of type RobinBird.FirebaseTools.Storage.Addressables.FirebaseStorageAssetBundleProvider which cannot be converted to requested type UnityEngine.ResourceManagement.ResourceProviders.IAssetBundleResource. The operation will be marked as failed.
    Code (CSharp):
    1. OperationException : GroupOperation failed because one of its dependencies failed
    2. OperationException : Provider of type RobinBird.FirebaseTools.Storage.Addressables.FirebaseStorageAssetBundleProvider with id RobinBird.FirebaseTools.Storage.Addressables.FirebaseStorageAssetBundleProvider has provided a result of type RobinBird.FirebaseTools.Storage.Addressables.FirebaseStorageAssetBundleProvider which cannot be converted to requested type UnityEngine.ResourceManagement.ResourceProviders.IAssetBundleResource. The operation will be marked as failed.
    PS: the remote catalog Is updated correctly from firebase storage
    PS2: I tested this:
    Code (CSharp):
    1. var reference = FirebaseStorage.DefaultInstance.GetReferenceFromUrl("gs://XXXX-XX/XXXX/v5/iOS/remote_scenes_assets/scenes/menunovedades.unity_b556af05549787a2bbd6ef86524da93c.bundle");
    2.             reference.GetDownloadUrlAsync().ContinueWithOnMainThread(task =>
    3.             {
    4.                 if (task.IsCanceled || task.IsFaulted)
    5.                 {
    6.                     Debug.LogError($"Could not get url: {task.Exception}");
    7.                     return;
    8.                 }
    9.                 string url = task.Result.ToString();
    10.                 Debug.Log($"We got url: {url}");
    11. }
    and I get the url correctly
     
    Last edited: Apr 13, 2023
  32. homelleon

    homelleon

    Joined:
    Jan 9, 2019
    Posts:
    9
    Hello. Seems like AssetBundleProvider works differently at Android then in Editor.
    I can download files in Edtior but Andorid build has strange url at the end.

    So I recieved "transformed log with correct url":
    AndroidPlayer "HUAWEI_ANE LX1@ADB:" Transformed https://firebasestorage.googleapis.com/v0/b/project.appspot.com/o/Addressables%2FAndroid%2Fremote_assets_assets%2Ffonts%2Fliberationsanssdf.asset_ef339cd284ba9f6531f8822a535374b2.bundle?alt=media&token=hidden to https://firebasestorage.googleapis.com/v0/b/project.appspot.com/o/Addressables%2FAndroid%2Fremote_assets_assets%2Ffonts%2Fliberationsanssdf.asset_ef339cd284ba9f6531f8822a535374b2.bundle?alt=media&token=hidden

    Not firebase file anymore:
    AndroidPlayer "HUAWEI_ANE LX1@ADB:" No Firebase file. Redirecting to base Unity provider

    And base Unity Provider failed to download link with replaced %2F (decrypted "/" sign) by %252F (what is double decrypted "/" sign). I know that it is already not about the topic asset but maybe someone understand that better.

    AndroidPlayer "HUAWEI_ANE LX1@ADB:" Web request failed to load from cache. The cached AssetBundle will be cleared from the cache and re-downloaded. Retrying...
    ProtocolError : HTTP/1.1 404 Not Found
    ResponseCode : 404, Method : GET
    url : https://firebasestorage.googleapis.com/v0/b/project.appspot.com/o/Addressables%252FAndroid%252Fremote_assets_assets%252Ffonts%252Fliberationsanssdf.asset_ef339cd284ba9f6531f8822a535374b2.bundle?alt=media&token=hidden


    Added:
    Seems like I missed one clause in AssetBundleProvider:
    upload_2023-7-19_11-5-42.png
    So I'm using Windows and that's why url evaluation is different at Android. If I guess how to fix, I'll add the info here.
     
    Last edited: Jul 19, 2023
  33. homelleon

    homelleon

    Joined:
    Jan 9, 2019
    Posts:
    9
  34. elfasito

    elfasito

    Joined:
    Jul 4, 2017
    Posts:
    51
    Last edited: Aug 10, 2023