Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

(Case 1099061) Cannot load assets on android

Discussion in 'Addressables' started by M_R, Nov 9, 2018.

  1. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    558
    Hi,
    I tried to load a local group on android using AA 0.4.8, but Addressables couldn't initialize.

    upon further digging, i found that settings.json contains this:
    Code (json):
    1.   "m_catalogLocations": [
    2.     {
    3.       "m_keys": [
    4.         "1_RemoteCatalog_24a731ec890f44040920b6e2cbdba227",
    5.         "catalogs"
    6.       ],
    7.       "m_internalId": "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/catalog_2018.11.09.11.30.40.json",      "m_provider": "UnityEngine.AddressableAssets.ContentCatalogProvider",
    8.       "m_dependencies": [
    9.         "RemoteCatalogHash24a731ec890f44040920b6e2cbdba227",
    10.         "LocalCatalogHash24a731ec890f44040920b6e2cbdba227"
    11.       ]
    12.     },
    13.     {
    14.       "m_keys": [
    15.         "LocalCatalogHash24a731ec890f44040920b6e2cbdba227"
    16.       ],
    17.       "m_internalId": "{UnityEngine.Application.persistentDataPath}/com.unity.addressables/catalog_2018.11.09.11.30.40.hash", <-- this line
    18.       "m_provider": "UnityEngine.ResourceManagement.TextDataProvider",
    19.       "m_dependencies": []
    20.     },
    21.     {
    22.       "m_keys": [
    23.         "RemoteCatalogHash24a731ec890f44040920b6e2cbdba227"
    24.       ],
    25.       "m_internalId": "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/catalog_2018.11.09.11.30.40.hash",
    26.       "m_provider": "UnityEngine.ResourceManagement.TextDataProvider",
    27.       "m_dependencies": []
    28.     }
    29.   ],
    that points to Application.persistentDataPath instead of Addressables.RuntimePath.

    indeed,
    BuildScriptPackedMode.CreateCatalog()
    has a hardcoded

    var localCacheLoadPath = "{UnityEngine.Application.persistentDataPath}/com.unity.addressables/catalog_" + playerVersion + ".hash";
    in line 282 that I think should either point to streaming assets instead, or I did miss an initialization step that should copy the catalog hash to there?
     
  2. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Thanks for submitting this case to us. We've got it on our radar now.
     
  3. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    558
    additional digging:
    - it also happens on osx standalone (so it seems not platform dependent)
    - it failed once in the editor (packed mode) but I couldn't repro
    - it succeeded once in the build, then it failed again when I uninstalled the app and cleaned all cached data from addressables window

    during the tests, I tried various configs (local, remote, hosting) and I also disabled 'Verify Saving Assets' from editor preferences
     
  4. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    558
    update: it appears that I can load on IL2CPP build, but not on Mono...
     
  5. gyx920820

    gyx920820

    Joined:
    Oct 8, 2015
    Posts:
    35
    It happens to me too! v0.4.8 android
     
  6. PaulBurslem

    PaulBurslem

    Unity Technologies

    Joined:
    Oct 7, 2016
    Posts:
    79
    The failure to load the cached catalog from {UnityEngine.Application.persistentDataPath} is not actually a failure - this is expected to happen if that file has not been cached yet. (Though we should probably suppress the error in this case). If you post your entire log file from the run I can help figure out what the actual reason for failed init is.
     
  7. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    558
    Hi,
    I attached the logs to the bug report
     
  8. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    558
    Hi,
    seems like this issue is fixed with 0.5.2

    now I get magenta if I use the default sprite material/shader (a custom shader works)
     
  9. hololabs

    hololabs

    Joined:
    Nov 15, 2012
    Posts:
    20
    I am attempting to instantiate prefabs with sprite dependencies and I'm also getting magenta/blank shaders show up even with a custom diffuse shader I have. Not sure what is happening because the profiler says the assets are loading. The game object is loaded and has a reference to a sprite but the shader reads Hidden/InternalErrorShader for the default material and just appears magenta for my custom one. I'm using 0.5.3. Is there a specific way we need to handle dependencies that I'm missing?