Addressables LoadAssetAsync call errors with Object reference not set to an instance of an object
I'm studying addressable assets for 2 months now. My desired workflow is having one project to create assets and a second project loads them.
When I try LoadAssetAsync, it throws this error right away on that line.
[code] Exception encountered in operation Resource(Yellow Capsule.prefab): Object reference not set to an instance of an object UnityEngine.AddressableAssets.Addressables:LoadAssetAsync(IResourceLocation) AssetLoader:LoadAsset(IResourceLocation) (at Assets/Scripts/AssetLoader.cs:71) <>c_DisplayClass8_0:b_0(AsyncOperationHandle) (at Assets/Scripts/AssetLoader.cs:65) DelegateList`1:Invoke(AsyncOperationHandle) (at Library/PackageCache/com.unity.addressables@1.8.4/Runtime/ResourceManager/Util/DelegateList.cs:69) UnityEngine.ResourceManagement.ChainOperation`2:OnWrappedCompleted(AsyncOperationHandle`1) DelegateList`1:Invoke(AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.8.4/Runtime/ResourceManager/Util/DelegateList.cs:69) UnityEngine.ResourceManagement.ResourceManager:Update(Single) MonoBehaviourCallbackHooks:Update() (at Library/PackageCache/com.unity.addressables@1.8.4/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:19) [/code]
The weird thing here is that the line that it points to is this line of code. [code] var handle = Addressables.LoadAssetAsync(location); [/code]
I'm sure the null reference isn't pointing to the location as I'm able to get the location's PrimaryKey. To prove that, please check this screenshot which tells that it is loading the specific asset.
Answer by ProgrammingWhileSleeping · Sep 26, 2020 at 02:16 PM
Tagging @unity_bill as he seems to be the man who can halp thanks!
I have a very similar problem. Any solutions to that ? The location exists by the loadassetasync throws object reference not set to an object error.
Your answer
Follow this Question
Related Questions
how to load texture from C:\ Folder at Runtime build 2 Answers
Access Gameobjects and Text Assets From a list of Folders 0 Answers
How to open files in the game's StreamingAssets folder of game on steam ? 0 Answers
Load Scene from dynamic location at runtime 1 Answer
How to remove old and unnecessary addressables assetpacks from the device 1 Answer