Addressables not loading in build

Unity: 2018.4.23f1
Addressables v 1.11.2
Platform: Macos 10.15.5

When attempting to initialize Addressables in build, I’m confronted with the following error messages:

In editor everything works fine. This includes running using the ‘Use Asset Database (Fastest)’ and ‘Use Existing Build (requires built groups)’. The groups for the editor and the player build are both built using the ‘Default’ profile, and I can see the bundles and additional files in the build (see attached screenshot).

The contents of the ‘settings.json’ file reads as follows:

So everything pretty standard. I’m a bit puzzled to what is happening exactly. Anyone that could help shed some light on this?

Thanks in advance!

6057941--655748--Screenshot 2020-07-05 at 22.28.11.png

1 Like

Bump & small update on this…

I get mixed success in initializing Addressables. Addressables.InitializeAsync() works ±1/40th of the time when a build is produced, for example, I produce a minimal build with just 1 group enabled for the build, it works. I create a second one with more groups enabled, it works. I make a third one, no changes, it no longer works and all coming after that don’t work.

Since Addressables in 1.11.2 don’t trigger any exceptions anymore and merely log them, I can’t hook in into my debugger, I downgraded to 1.8.3 (the version on which I picked up on Addressables), and traced the issue to some value being null in the initialization process.

I haven’t been able to produce a minimal reproducible scenario (I tried to setup minimal scenes, resources and prefabs groups etc, but they all load fine…). So any help on this would be greatly appreciated.

What I’m mainly looking for is a reason why m_RtdOp.Result could be null… I assume that something similar is going wrong in 1.11.2.

Thanks in advance.

Just wanted to jump in here to let you know I’m getting the exact same issue, with:

Unity: 2019.4.1f1
Addressables v 1.11.2
Platform: Macos 10.15.5

It’s the end of my day here, but I’ll see what I can dig up with this tomorrow. might be worth noting that our other platforms are building and running ok (windows standalone, iOS, Android) so not sure what’s going on here

@joe_nk ‘Glad’ to hear someone else is running into the same issue. My primary machine is a mac, so I’ve been exclusively been testing on this. At work, I had a Windows machine at my disposal, and whatever we do, it doesn’t seem to be happen there. So it re-affirms my and your assumption that it is mac-specific.

I filed a bug report, ID: 1261896

Not sure if tagging like this is allowed, my apologies if not: @unity_bill , @davidla_unity

So I’ve been digging and this appears to be the issue:

BuildScriptFastMode stores the path to the addressable assets settings file into your player prefs like so:

PlayerPrefs.SetString(Addressables.kAddressablesRuntimeDataPath, $"GUID:{guid}");

These player prefs then persist and are used when initialising a standalone player here:

public AsyncOperationHandle<IResourceLocator> InitializeAsync()
{
    return InitializeAsync(ResolveInternalId(PlayerPrefs.GetString(Addressables.kAddressablesRuntimeDataPath, RuntimePath + "/settings.json")));
}

If you change the above block in AddressablesImpl.cs to this:

public AsyncOperationHandle<IResourceLocator> InitializeAsync()
{
    return InitializeAsync(ResolveInternalId(RuntimePath + "/settings.json"));
}

it should work. I’m not sure if this is intentional, @unity_bill perhaps PlayerPrefs should be avoided, if not an editor build?

Instead of modifying the addressables code, you could also add a build step that clears this PlayerPrefs value so that you can run the build on the same machine you’re developing on

3 Likes

I want to confirm that this fixed it for me indeed. Thanks @ -nk for digging through this one!

1 Like

I got this error too, thanks for the solution.
Addressables is so frustrating. Every update fixes something but then breaks something else.

8 Likes

Same here.

Addressables v 1.15.1
Unity 2019.4.8f1
Android

I have the same problem here, and no, i could find what @ -nk showed, it only shows the PlayerPrefs, but not the other part, so i can’t apply your solution, unfortunately.

Unity: 2019.4.8f1
Addressables v 1.8.5
Platform: Android

This has been fixed, I think in in v1.15.1? If you can’t upgrade, call early on, before doing anything with the Addressables API:

#if !UNITY_EDITOR
PlayerPrefs.DeleteKey(Addressables.kAddressablesRuntimeDataPath);
#endif

Yeah, i just tested that alternative, but the addressables are still missing on build. It seems i’ll have to upgrade to see if that solves the problem (good thing i made a backup just in case).

Update: I upgraded the Addressables to 1.16, but the problem still persists in all Play Mode Scripts. @joe_nk not sure if there is another alternative for that version or i can apply that same solution one way or another.

Just in case, i’m showing the other assets i’m using for my project, in case someone wants to tell me if there is a incompatibility or extra change i have to do:

  • Amplify Color
  • SimpleInput
  • DOTween
  • Unity UI Extensions
  • AdjustPivot
  • Save Game Gold

Update 2: Yeah, i just gave up and started to use another alternative. I’m probably one of the unfortunate one who got a breaking bug on Addressables and i can’t use it anymore (at least, for my current project).

4 Likes

Happened to me again with :

Addressables v 1.16.1
Unity 2019.4.8f1
Android

1 Like

I can confirm it Happens on windows machine also.

Unity Version 2018.4.28f1
Addressable version: 1.16.6

Adding the above lines at Start() function before anything does not solve the issue and still gives the same error in the build.
Unity Version 2018.4.28f1
Addressable version: 1.16.6

Did anybody solve this issue? I have it in my WebGL build and I’m not sure what to do because i have iOS build, for example, and it works just fine.

Addressables v 1.16.7
Unity 2018.4.26f1
WebGL

I’ll flag this with the team, and relay any updates they have.

Well, in case of WebGL the problem was that I wasn’t hosting my build on local server. I was just launching it through file:/// path. Hosting my build on local server and running it through localhost helped to load addressables without any errors.

Team definitely thinks there is a bug in there somewhere. They are having a look.

2 Likes

blocked on this; I get it when trying to run an exported project from 2019.4.13f1 in Android Studio 4.1.1 (addressables 1.16)