Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ARFoundation Failed to generated ARCore reference image library

Discussion in 'AR' started by Deadshot1994, Mar 24, 2020.

  1. Deadshot1994

    Deadshot1994

    Joined:
    Sep 6, 2015
    Posts:
    25
    Hi,

    I am using Unity 2019.3.0f6 with ARFoundation 3.0.1 and I am getting the error that it fails to generate a reference image library.

    My library consists of PNG files and some of them work when I put them in the ImageLibrary, while some of them don't, but they are all the same size and format with different images in them?

    Below is the screenshot of the error as well as the images that I'm using in the ImageLibrary.

    Any help would be kindly appreciated
     

    Attached Files:

  2. nikunj_trivedi

    nikunj_trivedi

    Joined:
    Nov 17, 2020
    Posts:
    1
    Any resolution on this ?
     
  3. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    334
    Hi @Deadshot1994, you should be able to click on the error that says "Output from arcoreimg:" in order to see what the error is. Most likely ARCore has rejected one or more images as not being suitable for image tracking.
     
    CyberBoar and MichaelDomanek like this.
  4. mtlight

    mtlight

    Joined:
    May 21, 2020
    Posts:
    2
    Hello,

    Im a trying to export the tabletop template, with no tweek and I have the same error when I try to build.
    Here is the output for arcoreimg; strangely it adds files to my desktop. Im on 2020.2

    BuildFailedException: Failed to generate image database. Output from arcoreimg:
    stdout:
    Image database generated at: C:/Users/matth/Desktop/UNITY.imgdb
    Image list file generated at: C:/Users/matth/Desktop/UNITY-imglist.txt
    ====
    stderr:
    ====
    UnityEditor.XR.ARCore.ARCorePreprocessBuild.BuildImageTrackingAssets () (at Library/PackageCache/com.unity.xr.arcore@4.0.10/Editor/ARCoreBuildProcessor.cs:333)
    UnityEditor.XR.ARCore.ARCorePreprocessBuild.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.xr.arcore@4.0.10/Editor/ARCoreBuildProcessor.cs:57)
    UnityEditor.Build.BuildPipelineInterfaces+<>c__DisplayClass15_0.<OnBuildPreProcess>b__1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at <433cbae83977409887e43d50043210d2>:0)
    UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at <433cbae83977409887e43d50043210d2>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

    Thanks for your help.
     
  5. javsezlol

    javsezlol

    Joined:
    Dec 4, 2019
    Posts:
    6
    same issue here
     
  6. mtlight

    mtlight

    Joined:
    May 21, 2020
    Posts:
    2
    Hi, In this case, my problem was that my folders had space in their names.
    The code started generating the images databases and list files at this adress : C:/Users/matth/Desktop/UNITY.imgdb
    Which doesn't exist, the path is longer but contained spaces in folder names.

    I had to rename my UNITY REPOSITORY to UNITYREPOSITORY and MY PROJECT to MYPROJECT etc.

    Hope this helps
     
  7. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,816
    We have a known issue in ARF with image file paths that include spaces. This is a known issue in all published packages at this time.


    We have a fix internally and will be publishing this fix at some point in the future.


    Currently, we advise ensuring that file paths do not include spaces.
     
    whgotjd1599 likes this.
  8. HullandDesign

    HullandDesign

    Joined:
    May 15, 2020
    Posts:
    1
    April 2021, using the 2021.1.0f1 version and still having this issue.
    BuildFailedException: Failed to generate image database. Output from arcoreimg:
    I have tried all the suggested fixes with no luck. using .jpg instead of.Jpg or PNG, having no space in the file path, and not specifying the image size. None of it works, if I can't use the AR Tracked Image Manager Script with an image library then are there any other solutions?

    Thank you XD
     
  9. notrealdotmp4

    notrealdotmp4

    Joined:
    Oct 11, 2019
    Posts:
    4
    I'm having the exact same problem here.

    BuildFailedException: Failed to generate image database. Output from arcoreimg:

    stdout:
    Image database generated at: C:/Users/gianf/OneDrive/Active.imgdb
    Image list file generated at: C:/Users/gianf/OneDrive/Active-imglist.txt

    ====

    stderr:

    ====
    UnityEditor.XR.ARCore.ARCorePreprocessBuild.BuildImageTrackingAssets () (at Library/PackageCache/com.unity.xr.arcore@4.1.5/Editor/ARCoreBuildProcessor.cs:333)
    UnityEditor.XR.ARCore.ARCorePreprocessBuild.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.xr.arcore@4.1.5/Editor/ARCoreBuildProcessor.cs:57)
    UnityEditor.Build.BuildPipelineInterfaces+<>c__DisplayClass15_0.<OnBuildPreProcess>b__1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at <0c3742f371b24679bcaa6fcc508d0cca>:0)
    UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at <0c3742f371b24679bcaa6fcc508d0cca>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
  10. TheVirtualMunk

    TheVirtualMunk

    Joined:
    Sep 6, 2019
    Posts:
    150
    +1
    Also, any characters not in in the english alphabet will create the "image not found in path" error; like ô or æ
     
  11. emeteozturk

    emeteozturk

    Joined:
    May 4, 2020
    Posts:
    1
    when i named the image "a" it worked!
     
  12. unity_aica01

    unity_aica01

    Joined:
    May 19, 2020
    Posts:
    86
    Hi everyone!
    I´m experiencing the same issue and has no sense, I checked out that the path dos not have any spaces, it still failing at 2 secons of build, its like trying to acess to de StreamingAssets folder which does not exist (I created one, thinking that maybe during build it will create the file it was looking for there but got the exact same issue, so i deleted it) I tried changing the ARCore package version but nothing changed and I was still not able to build my app... Finally i decieded to remove the package and every problem has gone (probably my AR part will not work, i have to test the apk, and probably reimport the package getting againg those problems)

    I really find annoying the fact that those are known issues for several years, so I don´t understand why it is not fixed yet
     
  13. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,128
  14. kev_the_gamedev

    kev_the_gamedev

    Joined:
    Sep 11, 2018
    Posts:
    2
    Hi all!

    EDIT: I attached a working image as well

    flame.jpg -> not working
    flame_v3 -> working

    After quite a time of debugging and research I finally found a solution to this problem: it seems like the image I was using was to plain. I"ll attach the image that caused the problem so you guys can check if you have a related problem.
     

    Attached Files:

    Last edited: Nov 8, 2021
    MilenaCa, TheLavaLamp and KishykszD like this.
  15. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324
  16. kingbaggot

    kingbaggot

    Joined:
    Jun 6, 2013
    Posts:
    51
    Low-scoring images with too few anchor points won't process and cause this error. If you're desperate to use this image then you can always add a couple of rects to the bitmap and it will let you process it - it should still pick up the original image when scanning - esp. on iOS which has much better image recognition.
     
  17. i_nazarov

    i_nazarov

    Joined:
    May 24, 2018
    Posts:
    1
    I met the same problem and I found that the cause was in script ARCoreBuildProcessor.cs. I created a new AR template project in Unity and it had ReferenceImageLibrary.asset file in ExampleAssets folder. Also I created my own scene with a new ReferenceImageLibrary file. I filled the new file with images but the old file left empty. So the problem is that ARCoreBuildProcessor finds all ReferenceImageLibrary files by their names but if one of them is empty it just cannot create database and stops build process with an error.

    A solution of this is just to remove all empty ReferenceImageLibrary files before starting build process.

    Hope Unity guys will pay attention to this problem. I think that if a database cannot be created due to empty library it should print a detailed warning message and proceed to the next library file instead of throwing an error.
     
    novaVision and tjPark like this.
  18. alexis_fernando27

    alexis_fernando27

    Joined:
    Apr 21, 2022
    Posts:
    1
    Just in case, someone have the same problem, the image shouldn´t be snake case, i have unity 2019.4.39, ARFoundation 4.1.7, ARCore XR Plugin 4.1.7.
     
    DININDU_ likes this.
  19. tjPark

    tjPark

    Joined:
    Mar 19, 2015
    Posts:
    13
    I had ReferenceImageLibrary which has not enough keypoints, but not used in the scene. However failed with the message like: you have images not enough keypoints.
    After removing ReferenceImageLibrary not using in the scene, the scene has been buildable
     
  20. Draxi_

    Draxi_

    Joined:
    Sep 6, 2015
    Posts:
    7
    This is the fix that worked for me. I already had no spaces or special characters in the path and by removing an image library that I created somewhere fixed it for me. It had a missing texture on one image. Probably some of my testing attempts.

    I'm using AR Foundation 5.0.3
     
  21. DININDU_

    DININDU_

    Joined:
    Jun 23, 2021
    Posts:
    1
    In my case there are no space in file paths. Tryed this solution & it worked for me.
     
  22. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    515
    I am not surprised the solution is provided by a Unity user, not a developer or support team... Holy s*** Unity! START TO CONTROL THE QUALITY OF YOUR PRODUCT!
     
  23. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,018