ARFoundation/ xcode - Failed to resolve image Library

Hi,

I’m working on a project that has built perfectly fine in the past, but recently the project has broken.

The xcode project runs and builds fine, however, the AR functionality no longer works. When test building and running on my iPhone within xcode, I receive this message/log error:

" InvalidOperationException: Failed to resolve image library _name of library_. There is no matching resource group, or the resource group does not contain any reference images. "

Within xcode, under the Unity-iPhone folder, the only thing that is there is ARReferenceObjects (but it is empty).

I build and work on the Unity project using Windows, and transfer the iOS build over to my MacBook to test and release for iOS.

Unity 2020.3.19.f1
ARFoundation 4.1.7

Thanks!

Ensure you are on the latest version of Xcode (currently version 13.2.1).

If that does not work, please file a bug.

I’m using Xcode 13.0 and it worked fine in the past? I strongly believe this isn’t an Xcode issue, and is something to do with Unity or Windows not building the image libraries correctly (if at all).

I found a forum somewhere with someone saying that Windows has a limit on the file path length, which might be causing the issue. I tried setting the build location a folder at D:\ but that hasn’t helped.

Like I said, the project use to run completely fine, but now the AR feature no longer works; and it correlates with the addition of more targets and libraries.

Ideally I need a fix or solution as this is a commercial products that needs to be released fairly soon.

Please file a bug.

I managed to find the solution!

This was the error I was receiving within Xcode when running the app on my iPhone and trying to use the AR feature:
" InvalidOperationException: Failed to resolve image library _name of library_. There is no matching resource group, or the resource group does not contain any reference images. "

The app I am building allows users to look at landmarks from around the world and see a cartoon/ drawn version in AR. The issue I had came from the way I was naming the image targets, and Windows limiting the length of file names and/or paths (I don’t actually know the specifics as to why it breaks).

The name of one of my image targets was 39 characters (32 without spaces), and this was the culprit. when Unity builds the AR Reference Images, it adds a large (seemingly random) string of character and numbers to the file. For example, an Image Target with the filename Alligator becomes Alligator_BB75C797-F69A-8748-A631-C5999486320E.arreferenceimage. Therefore, because one of my image targets already had a large name, when Unity tried creating a file by adding even more characters, Windows must have refused and prevented any more AR Reference Images to be built after that point.

I found that within the build folder, under Unity-iPhone > ARReferenceImages, only some targets were being built. Unity must just stop when it reaches a file that it can’t create and carry on with the rest of the build instead of failing and reporting a build error. The app is perfectly usable until you want to use the AR feature, at which point it just doesn’t work. In the case of my app, this meant that when I changed the AR Reference Library at runtime, the app could do so and prevent the user from then pressing anything (restarting was the only solution).

Hope this helps anyone in the future who comes across this problem! And maybe hopefully Unity can fix it so the build fails with an error message.

I am glad you were able to resolve your issue.

Attempting to debug an issue over a forum thread has continually proven to be impossible.

In filing a bug, you would be providing us with a version of the errant Unity project uploaded through a secure server to protect your work. After filing a bug, our incoming QA team will actively work with you to figure out the cause of the issue.

The issue could be in the project, or the issue could be in the AR Foundation code. Filing a bug ensures that we are able to track the issue to resolution.

If the source of the issue is in AR Foundation, we would love to fix the problem so that it no longer impacts you or any other users in the future.

I’ve submitted a bug report with the project, so hopefully something can come of it!

It’s a pretty niche error as it requires you to build an iOS project on Windows, and one of the image targets needs super long file name.

I think the easiest thing that could happen is that Unity just reports back when the image library fails to build (or doesn’t allow targets with a certain character length). The best solution would be if Unity didn’t add such a long string of characters to the existing file name.

What I love about this is:
“Attempting to debug an issue over a forum thread has continually proven to be impossible.”

Yet, the only valuable information to resolve the issue … is in the thread. From the user. Effectively helping other users. While an employee is telling them to stop troubleshooting, file a bug report that no one will know about, that will go dead, and will experience no support / troubleshooting and likely not even get resolved.

I’m thankful they ignored your advice and continued to put their findings on the forum for other people.

1 Like

Yup… They originally closed the thread after the blunt “Please file a bug” message. I had to make another thread complaining about it so that they could open it back up and allow me to share my fix. oof.

1 Like

I was able to sort this out - all thanks to you!

For other folks seeing this issue:

In our case we discovered that it was caused by us using multiple image libraries. This works as expected on Android, but on Apple it looks like Unity would only pack up the first library it finds (regardless if it is used or not). This resulted in the same error above and the missing image targets. I was able to trace that down because of your post - so a second thank you :slight_smile:

1 Like

Todd S is no longer with Unity but the advice to please file a bug is still very relevant: Unity QA: Building quality with passion

After you file a bug if you could share your bug number that would be helpful as well.