Image tracking: ReferenceImageLibrary not created on macOS Xcode

Hi guys,

I’m experiencing an issue with my AR app that uses image tracking. We are developing mainly for iOS.

So I am developing on my windows PC. And when I build the Xcode project my ReferenceImageLibraries get created in the Xcode project like they should, under: XcodeProject\Unity-iPhone\ARReferenceImages.xcassets

The following libraries are created:
ReferenceImageLibrary (My own images, that I need)
TestReferencesImageLibrary (I don’t have this in my assets, but is in the ARKit package and I guess Unity takes it from there. Not sure why it exports though because I am surely not referering to it anywhere.)
TestReferencesImageLibrary (Another copy of the above for some reason, and we don’t know why.)

So this already seems a bit off. (Not referring to them and a duplicate?)

However ofcourse, we are not really able to make this build on a windows pc, because when we do we get the following Warning in Unity:

xcrun (an Xcode tool) was not found. This is necessary to bake ARKit-specific data into an XRReferenceImageLibrary. XRReferenceImageLibrary assets will not work in asset bundles.

So that’s why we send over the project to a Mac pc and build it from there. But when we do only the following libraries are exported:
TestReferencesImageLibrary
TestReferencesImageLibrary (a copy?)

and not ReferenceImageLibrary which we need so much.

On macOS Unity gives us no warnings or errors.

Anybody got any experience with this issue? Or anybody that can help me out? I’m kinda out of leads…

The warning you saw when building your application on Windows only applies if your image library will be included in an AssetBundle (Unity - Manual: AssetBundles). If you are building your reference image library directly into the app, your XCode project built with Windows should work fine.

The presence of the TestReferencesImageLibrary might be a bug. Please file that: Unity QA: Building quality with passion

Hi @Rob-Reijnen i have exactly the same problem as you, i haven’t tried to pass the project on a mac yet because now i don’t have one available, you finally managed to solve the situation on your mac? did you have to go through any particular steps to successfully export the library there?

Hi @andyb-unity thanks for the information, but I am using the 4.1 version of ARFoundation which according to the documentation, as I think I understand, should not use asset bundles …

https://docs.unity.cn/Packages/com.unity.xr.arfoundation@4.2/manual/tracked-image-manager.html#using-reference-image-libraries-with-asset-bundles

In any case, I don’t need to put the libraries in asset bundles and I don’t even know how to do it … Could you explain to me how to tell Unity not to include them in asset bundles?

Thanks a lot to everyone