Search Unity

Bug XR Reference Image Library is not added to XCode Project

Discussion in 'AR' started by josefgrunig, Mar 29, 2023.

  1. josefgrunig

    josefgrunig

    Joined:
    Jan 23, 2017
    Posts:
    62
    When I build for iOS and open the Xcode Project the ReferenceImageLibrary is missing; instead I have two other AR Resource Groups named TestReferenceImageLibrary with two images each named "one" and "two" (they come from the ARKit XR Plugin and ARCore XR Plugin packages)

    Unity 2021.3.11f1 Silicon
    ARFoundation / ARKit / ARCore 4.2.7

    I already tried to delete the Library folder and reimport everything
    When building for Android I don't have issues
     
  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    Is your reference image library referenced by any AR Tracked Image manager components in any scenes in your build? Unity may strip unused assets if they aren't referenced by any scenes.

    There is a known bug where the TestReferenceImageLibraries are included in every build. Apologies for that!
     
  3. josefgrunig

    josefgrunig

    Joined:
    Jan 23, 2017
    Posts:
    62
    Hi, sorry for answering so late on this.

    Yes, the XR Reference Image Library is referenced by an AR Tracked Image Manager that is attached to the AR Session Origin, so its very strange...

    I can live with the TestReferenceImageLibraries bug, but can you point me to the case number so I can follow its resolution and update accordingly once fixed?
     
  4. floatingfactory

    floatingfactory

    Joined:
    Aug 18, 2016
    Posts:
    18

    We have the same issue but the XR Reference Image Library is referenced in the scene but it is still getting stripped.
     
  5. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
  6. nethz

    nethz

    Joined:
    Oct 17, 2014
    Posts:
    3
    I also encountered similar errors.
    截屏2023-05-06 21.12.54.png

    Could it be a problem caused by my use of Vuforia?
     
    Last edited: May 6, 2023
  7. josefgrunig

    josefgrunig

    Joined:
    Jan 23, 2017
    Posts:
    62
    @andyb-unity I was setting up a project to reproduce the issue and found out that the tracking actually works and the image is being recognised even if the ARReferenceImages is not listed anywhere. Is it built into the Scene Data and loaded at runtime?

    Here is what I did:
    1. Download ARFoundation Sample 4.2.7
    2. Import Project into Unity 2021.3.11f1 Silicon
    3. Open Scene BasicImageTracking
    4. Build to iOS (I cleared all other scenes, keeping only BasicImageTracking)
    5. Open Xcode Project: ARReferenceImages.xcassets will reference only the two test images
    6. Run on Device, point to "Rafflesia" image and it will track correctly
    It's probably not an issues at this point, simply it's strage and misleading to not see it listed in the ARReferenceImages.xcassets file.
     
  8. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    There is a bug in AR Foundation currently that causes the test reference image libraries to always be added to your build regardless of whether you reference them in a scene or not. This sounds like it might be related to that issue.
     
  9. josefgrunig

    josefgrunig

    Joined:
    Jan 23, 2017
    Posts:
    62
    Why is the Rafflesia image being tracked even if the ARReferenceImace.xcasset does not contain it? I am aware of the bug you mention, but here I don’t understand why the xrreferenceimage referenced in the BasicImageTracking Sample is missing in the build.
     
  10. EodyneDeveloper

    EodyneDeveloper

    Joined:
    May 19, 2018
    Posts:
    1
    I have the same error ARfoundation 5.0.5 and Unity 2022.2.16. Any solution yet?
     
  11. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
  12. josefgrunig

    josefgrunig

    Joined:
    Jan 23, 2017
    Posts:
    62
    @andyb-unity I have filed a bug report: IN-41863, thank you
     
    andyb-unity likes this.
  13. DutchRose-Jochem

    DutchRose-Jochem

    Joined:
    Mar 7, 2017
    Posts:
    2
    Any update on this? We're experiencing the same issue.
     
  14. josefgrunig

    josefgrunig

    Joined:
    Jan 23, 2017
    Posts:
    62
    You don't see your custom reference image library, but it should actually track the images.
    Regarding the test images, just ignore them
     
    andyb-unity likes this.
  15. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    Yeah we looked into this, and there was a change to AR Foundation years ago where the reference image libraries are now packaged directly into the build.

    We are aware of the issue where Test Images are always bundled as well. Still some conversations about how to handle this issue and how much of the image tracking workflow ought to be redesigned. If you'd like to weigh in, you can comment on the AR Foundation road map: https://unity.com/roadmap/unity-platform/xr.
     
    josefgrunig likes this.