Hi,
I am trying to generate an app on iOS using 3 XRReferenceImageLibraries. No issue when building for Android but ithere is a bug when building for iOS:
- When doing only 1 XRReferenceImageLibrary for all the images (137 !), one of the image generates an issue (Warning: unable to add AR reference image rendition … ignoring) and all the next images are not added too (Warning: unable to add AR reference image facet … [errno = 28] ignoring).
- When separating the XRRefenceImageLibrary into 3 XRReferenceImageLibraries the issues are the same (I though it could be the maximum number of images in each XRReferenceImageLibrary which could be limited on iOS) : same images are generating the same warnings / errors. there are more of less 50 images in each XRReferenceImageLibrary.
- But when using only 1 of the 3 (the one containing the first image generating the issue) the build succeeds and tracking seems to be OK even for the images rejected before.
So it seems it was not the image which is the issue but the way ARKit is managing the trackable images.
Can I use multiple XRReferenceImageLibrary in the same project with iOS ?
Has someone got an idea to deal with that ? Is it a bug ?
NB : Only 1 XRReferenceImageLibrary is used per scene and only 1 scene is loaded at a time (ARSession is reseted each time). I am using Unity 2022.3.14f1 with ARFoundation 5.1.1
Hope you can help.
PS : the XRReferenceImageLibraries are created from an Editor Script (using , and I have to lock one inspector per XRReferenceImageLibrary so Unity does not clear the database when opening another scene.
Process to create each XRReferenceImageLibrary :
string name = AssetDatabase.GenerateUniqueAssetPath("Assets/Resources/AR_BDD/AR_lib.asset");
XRReferenceImageLibrary lib = ScriptableObject.CreateInstance<XRReferenceImageLibrary>();
AssetDatabase.CreateAsset(lib, name);
Process to add an image in a database (giving the index):
XRReferenceImageLibraryExtensions.Add(lib);
XRReferenceImageLibraryExtensions.SetName(lib, index , image_name);
XRReferenceImageLibraryExtensions.SetSpecifySize(lib index, true);
XRReferenceImageLibraryExtensions.SetSize(lib, index, new Vector2(image_width, image_height));
XRReferenceImageLibraryExtensions.SetTexture(lib, index, image_texture, false);
And eventually :
AssetDatabase.SaveAssets();
AssetDataBase.Refresh();
NB : Database are created but seems not to be managed properly by Unity (2022.3.14f1) since I have to lock their inspectors to keep them OK before build (and first image of the XRReferenceImageLibraries are blinking in Inspector).