0

I have the following code and it works on Desktop but does not on Android. The logcat doesnt even get to show the FINGERS CROSSED log message. I tried to change the Play Mode Script option to "Use existing build (Android)" as well as "Use Asset Database". Nothing works. No any error messages. The callback never gets to run. What to do???

Update: actually I noticed that now it does not work in editor either. I think I am missing the method invokation...


      var address = "stored_jab";
      Addressables.LoadResourceLocationsAsync(address).Completed += checkAddressHandle =>
      {
        //If the list is greater than zero, the address is good.
        Debug.Log("__FINGERS CROSSED__");
        if (checkAddressHandle.Result.Count > 0)
        {
          Debug.Log("__SO FAR SO GOOD__");
          //make a call to load the actual asset
          Addressables.LoadAssetAsync<TextAsset>(address).Completed += handle =>
          {
            var filestring = handle.Result.text;
            var bytesFromBase64 = System.Convert.FromBase64String(filestring);
            BinaryFormatter formatter = new();
            MemoryStream ms = new MemoryStream(bytesFromBase64);
            samples = formatter.Deserialize(ms) as Dictionary<string, StoredPoseSample>;
            ms.Close();


            ExtractClassNamesAndValues();

            isInit = true;
            Debug.Log("__WOOHOOO!__");


          };
        }

        else //The address is bad
        {
          Debug.Log("__WHOOPS__");
        }
        //The handle must be manually released once you are done
        Addressables.Release(checkAddressHandle);
      };

Chris
  • 570
  • 2
  • 9
  • 19
  • Did you build addressables before building an app? Do you have some other errors in the logcat? – Morion Mar 17 '23 at 12:02
  • Hi. No errors in logcat. I built the addressables. I checked the apk file and looks like it is stored inside under path: /assets/aa/Android/defaultlocalgroup_assets_all_xxxxxxxx.bundle I think if the bundle was missing - the error would pop out at the `checkAddressHandle.Result.Count`, but the code just simply never steps inside the callback like the operation was never executed – Chris Mar 20 '23 at 03:50

0 Answers0