Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Getting an error with the Reference Image Library

Discussion in 'AR' started by Temp23457, Dec 1, 2023.

  1. Temp23457

    Temp23457

    Joined:
    Jan 28, 2022
    Posts:
    6
    Hello,

    I'm trying to work on an AR project for android in Unity 2022.3.11, with the plan to use marker images. I have currently set up my Reference Image Library and downloaded the latest versions of the AR Foundation and ARCore packages, however the current problem I have is that, when I click Build and Run, I get this exact error

    "
    BuildDatabaseFailedException: arcoreimg failed with exit code 1 and stderr:
    WARNING: Logging before InitGoogleLogging() is written to STDERR
    E1201 19:28:14.311405 8420 image_target.cc:72] Failed to decode image_raw_bytes.
    Failed to read image file: C:\Users\COMPUT~1\AppData\Local\Temp\bf8f37f862f14e0e8c315c749068b102\614b921969924bebb41332e137d49792.png.
    E1201 19:28:14.313985 8420 image_target.cc:72] Failed to decode image_raw_bytes.
    Failed to read image file: C:\Users\COMPUT~1\AppData\Local\Temp\bf8f37f862f14e0e8c315c749068b102\0fd2980d557543a9bad273027cb3bae2.png.
    E1201 19:28:14.318522 8420 image_target.cc:72] Failed to decode image_raw_bytes.
    Failed to read image file: C:\Users\COMPUT~1\AppData\Local\Temp\bf8f37f862f14e0e8c315c749068b102\1106899040254bffbae550b4d7aa7bb1.png.
    Failed to add some of the images to database.

    UnityEditor.XR.ARCore.ArCoreImg.BuildDb (UnityEngine.XR.ARSubsystems.XRReferenceImageLibrary library) (at ./Library/PackageCache/com.unity.xr.arcore@5.1.1/Editor/ArCoreImg.cs:102)
    UnityEditor.XR.ARCore.ARCoreImageLibraryBuildProcessor.BuildAssets () (at ./Library/PackageCache/com.unity.xr.arcore@5.1.1/Editor/ARCoreImageLibraryBuildProcessor.cs:37)
    Rethrow as Exception:
    -
    -
    -
    Error building XRReferenceImageLibrary Assets/TrackedImages/ReferenceImageLibrary.asset: The arcoreimg command line tool exited with code (1) and stderr:
    WARNING: Logging before InitGoogleLogging() is written to STDERR
    E1201 19:28:14.311405 8420 image_target.cc:72] Failed to decode image_raw_bytes.
    Failed to read image file: C:/Users/COMPUT~1/AppData/Local/Temp/bf8f37f862f14e0e8c315c749068b102/614b921969924bebb41332e137d49792.png.
    E1201 19:28:14.313985 8420 image_target.cc:72] Failed to decode image_raw_bytes.
    Failed to read image file: C:/Users/COMPUT~1/AppData/Local/Temp/bf8f37f862f14e0e8c315c749068b102/0fd2980d557543a9bad273027cb3bae2.png.
    E1201 19:28:14.318522 8420 image_target.cc:72] Failed to decode image_raw_bytes.
    Failed to read image file: C:/Users/COMPUT~1/AppData/Local/Temp/bf8f37f862f14e0e8c315c749068b102/1106899040254bffbae550b4d7aa7bb1.png."


    Failed to add some of the images to database.
    -
    -
    -
    UnityEditor.XR.ARCore.ARCoreImageLibraryBuildProcessor.Rethrow (UnityEngine.XR.ARSubsystems.XRReferenceImageLibrary library, System.String message, System.Exception innerException) (at ./Library/PackageCache/com.unity.xr.arcore@5.1.1/Editor/ARCoreImageLibraryBuildProcessor.cs:16)
    UnityEditor.XR.ARCore.ARCoreImageLibraryBuildProcessor.BuildAssets () (at ./Library/PackageCache/com.unity.xr.arcore@5.1.1/Editor/ARCoreImageLibraryBuildProcessor.cs:49)
    UnityEditor.XR.ARCore.ARCoreImageLibraryBuildProcessor.UnityEditor.Build.IPreprocessBuildWithReport.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at ./Library/PackageCache/com.unity.xr.arcore@5.1.1/Editor/ARCoreImageLibraryBuildProcessor.cs:74)
    UnityEditor.Build.BuildPipelineInterfaces+<>c__DisplayClass16_0.<OnBuildPreProcess>b__1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at <9920ff0c944845d7b9f9a61ef1478edc>: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 <9920ff0c944845d7b9f9a61ef1478edc>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)"

    What confuses me is this: The path "C:/Users/COMPUT~1/AppData/Local/Temp/bf8f37f862f14e0e8c315c749068b102" does not exist, it was never created by me nor did I ever specify to Unity to make this path. Equally, the images it is looking for i.e "614b921969924bebb41332e137d49792.png" do not exist either, I never created these images, they are instead in this path: "C:\Users\Computing\CMP9774M-AR-Section\Assets\TrackedImages\IMG_0847.png". I'm a bit confused therefore on what is going on and I need some advice because I can't find a solution anywhere.

    If anyone has any ideas please let me know
     
  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    956
    KyryloKuzyk likes this.
  3. Temp23457

    Temp23457

    Joined:
    Jan 28, 2022
    Posts:
    6
    Thank you, that was the cause. I will look at increasing the resolution.