Cannot get Addressables to work after successfully build onto Android?
HELP PLEASE: I have recently switched my Unity project to use the Addressables system to improve asset load speed. Everything works perfectly when I run in Unity playmode, however ONLY when I go to build to Windows or Android (which builds as "successful") the issue occurs and the assets dont load anymore.
Here is part of the script that just loads and instantiates an Addressable-marked gameobject onto the canvas when a button is clicked.
Where am I going wrong?
[SerializeField] Button bttn;
[SerializeField] Transform spawnPos;
private void Awake()
{
this.transform.Find("Bttn").GetComponent<Button>().onClick.AddListener(() => LoadPicture());
spawnPos = this.transform.Find("SpawnPos");
}
private void LoadPicture()
{
Addressables.LoadAssetAsync<GameObject>("Drink").Completed += drink =>
{
if(drink.Status == AsyncOperationStatus.Succeeded)
{
GameObject go = drink.Result;
GameObject g = Instantiate(go, transform.position, transform.rotation);
g.transform.SetParent(spawnPos, false);
}
else
{
Debug.Log("Load Failed");
}
};
}
Note: *I am using Unity Beta 2021.0.1.0b2 and have tried on the earlier releases. *My asset is marked as "Addressable"; *I build a "Default Build Script";
Thank you!
Answer by chgeorgiadis · Apr 20 at 08:14 AM
@Kerandon i have the same problem. When i am trying to load from apk nothing downloads. Have you found a solution?