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?
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.
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.
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
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
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).
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
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.