Preloading assets failure

Hello,

We have an issue with preloading the asset tables. The assets are audio files and materials. Weirdly we do not seem to get an error for all assets but for some amount only. The errors look like this:
Error Logs in console

Also when preloading is set off and we try to localize a material, we get the last 6 errors (above image). 6 with the same ID because we have 6 localization components. The custom component looks like this:
Inspector Component 7046473--835609--upload_2021-4-16_14-6-33.png and the code for it looks like this
LocalizeMaterialEvent.cs

public class LocalizeMaterialEvent : LocalizedAssetEvent<Material, LocalizedMaterial, UnityEventMaterial>
{
    [SerializeField] private MeshRenderer _renderer;
    [SerializeField] private int _materialIndex;

    private void Awake()
    {
        if (_renderer != null)
        {
            OnUpdateAsset.AddListener(SetMaterial);
        }
    }

    private void SetMaterial(Material material)
    {
        if (_renderer.materials.Length <= _materialIndex) return;
           
        var materials = _renderer.materials;
        materials[_materialIndex] = material;
        _renderer.materials = materials;
    }
       
    public void SetLocalizedMaterial(LocalizedMaterialAsset localizedMaterialAsset)
    {
        AssetReference = localizedMaterialAsset.LocalizedMaterial;
    }
}

Note, that we are using our own implementation of LocalizedMaterial (
code

[Serializable]
public class LocalizedMaterial : LocalizedAsset<Material>
{
}

). We implemented this just before 0.11.0 where you introduced your own.

Also, note that this is only an issue if the Play Mode Script is set to “Use Existing Build”. It is not an issue if set to “Use Asset Database”.

Unity: 2019.4.14f1
Chosen platform: Android
Addressables: 1.17.15
Localization: 0.11.0-preview

Have you tried rebuilding the addressables? It may be that you are using an old build with different data.
Also can you try and run the Analzer rules https://docs.unity3d.com/Packages/com.unity.localization@0.11/manual/Addressables.html#addressable-analyzers

1 Like

I’ve rebuilt the addressables more than I can count.

Here are the results of the analysis:
results 7046503--835615--upload_2021-4-16_14-30-42.png

I let it automatically fix some things. I also noticed this in my console:

And when playing then the following warning:
“Asset bundles built with build target Android may not be compatible with running in the Editor.”.

After automatic fix it doesn’t give the errors anymore but all of the meshes, which use the localized materials are pink. I’ll try in the build as well.

Sorry for the triple post but it seems to work in the Android build now. So running the analyzer and letting it fix the fixable issues seemed to resolve the issue. I wonder what could have caused these in the first place?
We’ve experienced issues with git automatically merging certain localization asset files and overwriting data. I wonder if this could be the case. Multiple people can edit tables at the same time (we have a rule that only 1 person can add/remove tables at any time though).

Those issues in the log are from the files that will be in the AddressableAssets folder not the localization tables. if it has no schema then it wont be able to load the group so that would explain why some assets were not working.
Not sure what would cause this issue though.

1 Like