Issue with AssetReference in Resources in Android

Ok, this is just guesswork at the moment. I’m working my way around to proving this is true but here is my problem and theory.

On Android builds my app is crashing on boot trying to allocate an insanely large block of memory. We’re using Zenject and the issue seems to happen when calling this line:

var prefabs = Resources.LoadAll(ProjectContextResourcePath, typeof(GameObject));

The file it’s loading is a prefab with a ProjectInstaller component on it. In my Installer, I’ve recently added this line

[SerializeField] private AssetReference[] _viewModels;

I haven’t managed to prove it yet but I feel like this is causing my app to crash. Is anyone aware of any issues like this already?

We had an issue with how AssetReference’s were serialized that should be fixed in 0.7.4-preview Please update to that version. If the issue persists, I’d try not loading the prefabs from Resources. Honestly we haven’t done a ton of testing around something like having an asset in Resources that utilizes Addressables. It should work, but it’s combining to different data management techniques.