Hi all,
I have a weird problem about Addressables. Everything works on Editor with Fast Mode (Play Mode Script). When I switch to Packed Play Mode, the Completed handler (AsyncOperationHandle) doesn’t fire. When I look at the Addressable Profilers, I can see the assets loaded.
I thought, maybe it only happens on Editor, but it didn’t work on Android as well. (My target platform is Android by the way). What could be the problem here?
introMusic = Addressables.LoadAssetAsync<AudioClip>(music);
// This line doesn't work. OnMusicLoaded is never called
introMusic.Completed += OnMusicLoaded;
Are you yielding on that introMusic object? I think you’ll get your data if you just wait, but having the callbacks fire might be reliant on properly yielding on it in a coroutine.
I didn’t understand what you mean by “yielding”. If you mean “wait until load”, that logic doesn’t work for me. I already made a class to load/release assets for me automatically. That code is the simplified version of the loading asset function, and everything work fine with Fast Mode.
The code is in Start function though. It loads the intro music. In OnMusicLoaded function, it sets the audio clip of an audio source and plays the music.
I really don’t understand why Unity cannot load addressable when I build?
I assumed you had read the documentation and seen the example code, which is a coroutine and yields.
https://docs.unity3d.com/Packages/com.unity.addressables@1.15/manual/LoadingAddressableAssets.html
Coroutines and yielding form the basis for ALL of Unity’s async operations.
I don’t like that Coroutine approach for Addressables. I made a class to track every asset in the memory in order to prevent duplication in case another object needs to use the same assets.
The problem is Completed handler doesn’t fire in the build, which it should be. This drives me crazy. I’m about to change my logic to Resources instead of Addressables, just because this stupid bug or whatever.
I print a debug message to see what is going on, and here’s the result.
The AsyncOperationHandler stucks at 0.33 (33%). Even if I use Coroutines, it never works. What could be the problem? Is that a bug? The interesting thing is I can see the IntroMusic.wav is loaded in Addressable Profiler.

Since it is an AudioClip, is it perhaps marked as Streaming and thus only loads a certain distance and you have to start playing it to make it load the remainder?
You are focusing only one thing. Everything works fine with “Fast Mode”. My problem is general. Regardless of the data, it never loads anything; but I think I find the issue. It actually gets stuck at loading.
I created a new thread about this and explained everything. You can read my last post in the thread.
https://discussions.unity.com/t/821684