Updating to 1.18.2 busts my project

I updated from Addressables version 1.17.17 to 1.18.2 and it creates a handful of super weird bugs and breaks my game. Downgrading back to 1.17.17 fixes it and it runs like it should again.

I can’t really pin-point what exactly is happening, but I’ve narrowed part of the problem down to Addressable.LoadAssetsAsync(“Mandatory”, null). Which loads all of my mandatory assets in at start up. It’s as if calling this, is instantiating some of the various objects that it loads. The bug happens every single time when running version 1.18.2, so it’s easy to reproduce. Not sure if anyone else is having these breaking issues with this version, but I figured I’d post it as I’d like to continue using the newest versions of the Addressables.

2 Likes

Please file a bug report for us so that we can have a look. :slight_smile:

Same problem here. Everything is busted.
I also get this error.

Exception: Attempting to use an invalid operation handle
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle.get_InternalOp () (at Library/PackageCache/com.unity.addressables@1.18.2/Runtime/ResourceManager/AsyncOperations/AsyncOperationHandle.cs:430)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle.Release () (at Library/PackageCache/com.unity.addressables@1.18.2/Runtime/ResourceManager/AsyncOperations/AsyncOperationHandle.cs:501)
UnityEngine.ResourceManagement.ResourceManager.Release (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle handle) (at Library/PackageCache/com.unity.addressables@1.18.2/Runtime/ResourceManager/ResourceManager.cs:590)
UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider.ReleaseInstance (UnityEngine.ResourceManagement.ResourceManager resourceManager, UnityEngine.GameObject instance) (at Library/PackageCache/com.unity.addressables@1.18.2/Runtime/ResourceManager/ResourceProviders/InstanceProvider.cs:35)
UnityEngine.ResourceManagement.ResourceManager+InstanceOperation.Destroy () (at Library/PackageCache/com.unity.addressables@1.18.2/Runtime/ResourceManager/ResourceManager.cs:883)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].DecrementReferenceCount () (at Library/PackageCache/com.unity.addressables@1.18.2/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:184)
UnityEngine.ResourceManagement.ResourceManager.CleanupSceneInstances (UnityEngine.SceneManagement.Scene scene) (at Library/PackageCache/com.unity.addressables@1.18.2/Runtime/ResourceManager/ResourceManager.cs:1000)
UnityEngine.AddressableAssets.AddressablesImpl.OnSceneUnloaded (UnityEngine.SceneManagement.Scene scene) (at Library/PackageCache/com.unity.addressables@1.18.2/Runtime/AddressablesImpl.cs:187)
UnityEngine.SceneManagement.SceneManager.Internal_SceneUnloaded (UnityEngine.SceneManagement.Scene scene) (at <9baebf9af86541678fd15bfdbf5f26eb>:0)

It happens every single time. Unfortunately I really do not have time to track down a minimal repro given that there’s no actual readable errors… Everything works under 1.17.17. I’m happy to provide my entire project, but it is 13GB.

Edit: I couldn’t leave well enough alone and created and submitted a repro.

The problem is just as OP says. Addressables is running scripts on assets when you call LoadAssetAsync.

Case: 1333545 (fogbuz)

1 Like

Could it be related to this change:

“Fixed issue where loading of Prefabs and ScriptableObjects in “Use Asset Database” and “Simulate Groups” play mode could cause changes to source Assets. Now those play modes will return instanced copies of the Assets.”

Think I’ll be skipping 1.18.2 :frowning:

1 Like

I will have a look into this, that change does make instances of Prefabs before providing them in ADB mode. For now, using 1.17 or “Use Existing build” will work as you need.

Hi @andymilsom . I also would like to inform u that 1.18.2 breaks my dots project. From my observation, even u use Addressables.InstantiateAsync there’s prefab created internally before Instantiate actual game object. Now the behavior of prefab has been changed to behave like game object meaning Convert and Inject Game Object become creating 2 entities instead of 1 entity and turns out breaks my project.

2 Likes

I think there should be a setting for such aggressive change.

1 Like

When I update To 1.18.2
In Use AssetDataBase Module My Prefab Contains EventSytem is failure,All UIs cannot be clicked,
In Use Existing Build it work
Good Job With Adressables

Second this, Addressable.InstantiateAsync() an asset will load a prefab, as well as create an instance. However, the loaded one will also call Awake() and Start().

That should not be the case! I check 1.15, it’s not the same!

The bad thing is, I have already published my remote asset in a live project using 1.18.2. I didn’t notice this problem as I only used addressable to load audio assets.

Now I start to use addressable to load game object prefabs, this wrong behavior needs to be fixed.
I hope reverting back to previous version won’t break my live release…


To reproduce this problem with 1.18.2 is easy, in official demo, e.g. Basic Reference scene, update the addressable package to 1.18.2, attach a new script on cube prefab, do a debug print in awake and start.
You will see output like this:
======= Cube(Clone) Awake =========
======= Cube(Clone) Awake =========
Assertion failed on expression: ‘ShouldRunBehaviour()’
Assertion failed on expression: ‘ShouldRunBehaviour()’
======= Cube Start =========
======= Cube(Clone) Start =========

Twice of Awake and Start.

1 Like

This will be fixed in the next upcoming release, I currently have it fixed to address both the original bug and the new one. And will be investigating more before the update to see if there are any edge cases that I haven’t concidered.

3 Likes

After looking into all the options available, it was decided that the original change should be reverted. The changes were intended to make AssetDatabase mode work the same as Existing Build/Release. Though we can address the issue for Prefabs calling methods, we cannot do it for ScriptableObjects at this time. Other issues such as if you have a ScriptableObject that references a Prefab, that Prefab would be the Project Asset. At this time the solution is causing more problems than the original issue (making changes to loaded Assets in Asset Database mode, modifies to actual project asset.).
The next release 1.18.5 expected within a few days will fix all the issues in this thread.

3 Likes

Nice, looking forward to it. Especially now that latest localization package requires addressables 18.2

1 Like

@andymilsom it sounds like you guys have things figured out at this point, but if needed there’s more info and some bug reports in this thread:

Thank you, I will post on that threat also.

@andymilsom Is there a planned release date yet for the next addressables release? Thanks

@davidla_unity is there any word on when the next Addressables release might be ready?

Sorry for the delay, we had delays causing the release to keep getting pushed back.
Addressables 1.18.9 has now been released, and has the fix to this issue.

2 Likes

Thank you for the fix! I’m just confirming that updating to the most recent version (1.18.9) does indeed work as intended. :slight_smile:

1 Like