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

Can't load bundle with unity built-in shaders

Discussion in 'Addressables' started by Keep507, Jun 17, 2022.

  1. Keep507

    Keep507

    Joined:
    Aug 10, 2021
    Posts:
    3
    Hi! I met strange issue when added to addressable bundle an asset which use a built-in shader - for some reason, on loading dependencies it tries to load
    unitybuiltinshaders.bundle
    as JSON though it is binary. (doesn't depend on platform, happening in editor)

    Preload bundle with the asset:
    Code (csharp):
    1. Addressables.DownloadDependenciesAsync(new List<string> {...}, Addressables.MergeMode.Union);
    Exceptions:
    Code (csharp):
    1. ArgumentException: Cannot deserialize JSON to new instances of type 'IAssetBundleResource.'
    2. UnityEngine.JsonUtility.FromJson (System.String json, System.Type type) (at <0b59f3b614a04547a8bf657de1e23f2c>:0)
    3. UnityEngine.ResourceManagement.ResourceProviders.JsonAssetProvider.Convert (System.Type type, System.String text) (at Library/PackageCache/com.unity.addressables@1.19.19/Runtime/ResourceManager/ResourceProviders/JSONAssetProvider.cs:20)
    4. UnityEngine.ResourceManagement.ResourceProviders.TextDataProvider+InternalOp.ConvertText (System.String text) (at Library/PackageCache/com.unity.addressables@1.19.19/Runtime/ResourceManager/ResourceProviders/TextDataProvider.cs:143)
    5. UnityEngine.AsyncOperation:InvokeCompletionEvent()
    6.  
    7. OperationException : Unknown error in AsyncOperation : Resource<IAssetBundleResource>(StandaloneWindows64\c7a560711722c2a503b6e84889a4a5e7_unitybuiltinshaders.bundle)
    There is specialty that assets and code are in separate projects, code project uses existing bundles that were built from the asset project.
    I tried to reproduce it in a new project (single), but no the issue.

    Unity 2020.3.11f1, addressable 1.19.19.

    Does anyone have idea what it could be the reason?
     
  2. andymilsom

    andymilsom

    Unity Technologies

    Joined:
    Mar 2, 2016
    Posts:
    294
    Keep507 and Rekart like this.
  3. Keep507

    Keep507

    Joined:
    Aug 10, 2021
    Posts:
    3
    Thanks!