Image in Asset bundle added at runtime cannot be recognized

Hi,
I have built an Asset Bundle file containing many images and added them to MutableRuntimeReferenceImageLibrary at runtime. I have printed to verify that all images are contained in reference lib(line 150) and it was added successfully. Initially, the m_xRReferenceImagesLibrary contain 2 images and both can be tracked, but my image added at runtime cannot be recognized. The evidence is that Debug.Log didn’t print the name of these images (line 185).
I’m using Unity 2022.3.7 and AR Foundation 5.1. Both Editor XR Simulation and Android have this problem.
Can anyone help or maybe suggest another way that I can handle this problem?

using ARENKid.DataControllers;
using ARENKid.Utils;
using glTFLoader2.Schema;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
using UnityEngine.XR.ARFoundation;
using UnityEngine.XR.ARFoundation.Samples;
using UnityEngine.XR.ARSubsystems;
using static Unity.VisualScripting.Member;

namespace ARENKid.MainModule
{
    public class ARENKidImageTrackingController : MonoBehaviour
    {
        [Serializable]
        struct NamedPrefab
        {
            // System.Guid isn't serializable, so we store the Guid as a string. At runtime, this is converted back to a System.Guid
            public string imageGuid;
            public GameObject imagePrefab;

            public NamedPrefab(Guid guid, GameObject prefab)
            {
                imageGuid = guid.ToString();
                imagePrefab = prefab;
            }
        }

        [SerializeField] private UnityEngine.UI.Image image;

        [SerializeField] private ARTrackedImageManager m_aRTrackedImageManager;
        [SerializeField] private XRReferenceImageLibrary m_xRReferenceImagesLibrary;
        private Dictionary<Guid, GameObject> m_PrefabsDictionary = new();
        [SerializeField] private MainARElementController m_mainARElementController;

        [SerializeField] private XRReferenceImageLibrary m_runTimeLib;

        public MainARElementController mainARElementController
        {
            get
            {
                if(m_mainARElementController == null)
                {
                    m_mainARElementController = FindAnyObjectByType<MainARElementController>();
                }
                return m_mainARElementController;
            }
        }

       
        private ARTrackedImageManager aRTrackedImageManager
        {
            get
            {
                if(m_aRTrackedImageManager == null)
                {
                    m_aRTrackedImageManager = GetComponent<ARTrackedImageManager>();
                }   
                return m_aRTrackedImageManager;
            }
        }

        private void Awake()
        {
           
        }

        async void Start()
        {
            AddFlashToReferenceLib();   
        }

        private async void AddFlashToReferenceLib()
        {
            m_aRTrackedImageManager.referenceLibrary = m_aRTrackedImageManager.CreateRuntimeLibrary(m_xRReferenceImagesLibrary);

            var flashcards = await AssetBundleLoader.instance.LoadAllAsset<Texture2D>(Path.Combine(Application.persistentDataPath, "archive/Flashcards/flashcards.unity3d"));

            var runTimeLib  = m_aRTrackedImageManager.referenceLibrary as MutableRuntimeReferenceImageLibrary;

            Debug.Log("supportsMutableLibrary: " + m_aRTrackedImageManager.descriptor.supportsMutableLibrary);

            var texture = flashcards[1];
            //image.sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);

            foreach (var flashcard in flashcards)
            {
                var widthInPixels = flashcard.width;
                var heightInPixels = flashcard.height;
                var widthInMeters = 0.3f;
                var aspectRatio = (float)widthInPixels / (float)heightInPixels;
                var sizeInMeters = new Vector2(widthInMeters, widthInMeters * aspectRatio);
                var referenceImage = new XRReferenceImage(
                    new SerializableGuid(),
                    new SerializableGuid(),
                    sizeInMeters, flashcard.name, flashcard);



                var jobState = runTimeLib.ScheduleAddImageWithValidationJob(
                    flashcard.GetRawTextureData<byte>(),
                    new Vector2Int(widthInPixels, heightInPixels),
                    flashcard.format,
                    referenceImage);


                while (!jobState.jobHandle.IsCompleted) ;
                jobState.jobHandle.Complete();
            }

            m_aRTrackedImageManager.referenceLibrary = runTimeLib;

            m_aRTrackedImageManager.enabled = true;

            foreach (var imgref in runTimeLib)
            {
                Debug.Log($"Image in lib {imgref.name}");
                Debug.Log($"Image in lib {imgref.guid}");
            }
        }

        void Update()
        {

        }

        private void OnEnable()
        {
            aRTrackedImageManager.trackedImagesChanged += OnTrackedImagesChanged;
        }

        private void OnDisable()
        {
            aRTrackedImageManager.trackedImagesChanged -= OnTrackedImagesChanged;
        }

        protected void OnTrackedImagesChanged(ARTrackedImagesChangedEventArgs eventArgs)
        {
            foreach (var trackedImage in eventArgs.added)
            {
                // Give the initial image a reasonable default scale
                var minLocalScalar = Mathf.Min(trackedImage.size.x, trackedImage.size.y) / 2;
                trackedImage.transform.localScale = new Vector3(minLocalScalar, minLocalScalar, minLocalScalar);
                AssignPrefab(trackedImage);
            }
        }

        private void AssignPrefab(ARTrackedImage trackedImage)
        {
            var word_asset = DataModelController.GetWordAssetByID(trackedImage.referenceImage.name);

            Debug.Log($"Tracked image name: {trackedImage.referenceImage.name}");
            Debug.Log($"Tracked image name: {trackedImage.referenceImage.guid}");

            if (word_asset != null)
            {
                if (word_asset.Model3D != null)
                {
                    var model3D = word_asset.Model3D.GetRandom();
                    var model3d_path = DataModelController.Get3DModelPath(model3D);
                    ARENKid3DModelsLoader.LoadModel(model3d_path, trackedImage.gameObject, object3D =>
                    {
                        var modelBehaviorController = object3D.GetComponent<Model3DBehaviorController>();
                        if(modelBehaviorController != null)
                        {
                            modelBehaviorController.wordAsset = word_asset;
                            mainARElementController.Add3DObject(modelBehaviorController);
                            mainARElementController.SetObjectFocus(modelBehaviorController);
                            modelBehaviorController.model3DID = model3D.Id;

                        }
                    });
                }
              

            }
        }

        private GameObject GetPrefabForReferenceImage(XRReferenceImage referenceImage)
        {
            if(m_PrefabsDictionary == null)
            {
                return null;
            }   
            return m_PrefabsDictionary.TryGetValue(referenceImage.guid, out var prefab) ? prefab : null;
        }
    }
}

Unfortunately there are a lot of old bugs with AssetBundles that haven’t gotten much attention in the past year. You are welcome to file a bug for this: Unity QA: Building quality with passion

There’s not much else advice I can give until these issues are selected for development. Hopefully sometime in Q4.