Search Unity

Resolved Loading cached catalog without internet connection fails.

Discussion in 'Addressables' started by atylol228, Sep 21, 2021.

  1. atylol228

    atylol228

    Joined:
    Mar 11, 2020
    Posts:
    2
    Hi.
    All my Assets are stored on a remote server. I build the content catalog and upload it to the server. On the first run, I download all the catalogs with LoadContentCatalogAsync (I take the path to the catalogs on the server from the remote config) and if the download is successful, I save the path to the catalog in Player Prefs. The game works correctly. On the second run, I turn off the internet.

    Documentation says:
    the local hash of the catalog is compared against the hash of the remote catalog at the given location. If a different hash is detected, the remote catalog is downloaded, cached, and used. If the remote and local hash match, or if there is no internet connection, the cached catalog is used.

    But when I try to call LoadContentCatalogAsync on the exactly same path loaded from PlayerPrefs the Addressables try to download them over the internet and don't use the cached version of catalog. The catalog assets themselves are cached - I've checked. But the catalog itself might not be cached. It resulst with
    Code (CSharp):
    1. AsyncOperationBase`1: TextDataProvider unable to load from url https://s3.eu-central-1.amazonaws.com/com.name.name.ios/Development/startBundle/iOS/catalog_universal.hash, result='No Internet Connection'.
    If i turn internet on and call LoadContentCatalogAsync again it works fine and finds all cached assets from catalogs and loads it instantly.

    Is it because i use path with "https" prefix? Should i download catalog.json and catalog.hash myself and load from persistentDataPath? Should i add "file://" prefix? Should i enable crc check for assets?

    I use package 1.16.19
     
  2. atylol228

    atylol228

    Joined:
    Mar 11, 2020
    Posts:
    2
    UPDATE (SOLVED):
    Problem occured because of identical catalog names. I used three secondary catalogs and addressables actually cached catalog but each time replaced cached copy with last downloaded catalog.
    If you have same problem, just name your secondary catalogs differently.