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. Dismiss Notice

Question Assets not loading in build InvalidKeyException

Discussion in 'Addressables' started by FlyVC, Aug 15, 2022.

  1. FlyVC

    FlyVC

    Joined:
    Jan 5, 2020
    Posts:
    24
    My game used to work with addressables, but after trying and failing to implement the Google play asset delivery, my build does not load addressables at all.

    In the editor everything works fine, but on the actual Android build, or when I switch to "Use existing build" in Play mode script, all LoadAssetAsync operations fail.
    failed asset handle.png
    exact error message:
    "Exception of type \'UnityEngine.AddressableAssets.InvalidKeyException\' was thrown. Could not load Asset with GUID=d82dc02ce1454d547abb75973937b38a, Path=Assets/Prefabs/VFX/Explosions/MobileExplosion3D_12.prefab. Asset exists with main Type=UnityEngine.GameObject, which is not assignable from the requested Type=UnityEngine.GameObject"

    The code already worked before, so its probably just something with the settings:
    assetgroup.jpg

    settings.JPG

    I'm super fed up with all those package version issues, I really hope someone can help here so I can finally go back to actual coding :confused:
     
  2. FlyVC

    FlyVC

    Joined:
    Jan 5, 2020
    Posts:
    24
    It finally worked, I had to set the Asset Provider to "Assets from Bundles Provider" and Asser Bundle Provider to "AssetBundleProvider"