Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.07k stars 1.15k forks source link

Failed to generated ARCore reference image library still happening #165

Closed jason268 closed 5 years ago

jason268 commented 5 years ago

Even in the samples provided.

Failed to generated ARCore reference image library 'ReferenceImageLibrary' UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Win32Exception: ApplicationName='/Volumes/Data Drive/OneDrive - S-One Holdings/Repos/MakersMark/Android/MakersMark/Library/PackageCache/com.unity.xr.arcore@2.1.0-preview.5/Tools~/MacOS/arcoreimg', CommandLine='build-db --input_image_list_path="/var/folders/by/sv2kdxys60g2sty7lx3h8nbm0000gn/T/6850b588c853436fb0f74f1661fa70ae/cac47b25f584451eb6c82a1f8ab77a8f.txt" --output_db_path="/Volumes/Data Drive/OneDrive - S-One Holdings/Repos/MakersMark/Android/MakersMark/Assets/StreamingAssets/HiddenARCore/e409a5e4-9933-44df-8c8a-0f8e5a22c8a8.imgdb"', CurrentDirectory='', Native error= Access denied System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) (at :0) System.Diagnostics.Process.Start () (at :0) (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start() UnityEditor.XR.ARCore.ARCorePreprocessBuild.BuildImageTrackingAssets () (at /Volumes/Data Drive/OneDrive - S-One Holdings/Repos/Makers Mark/Android/Makers Mark/Library/PackageCache/com.unity.xr.arcore@2.1.0-preview.5/Editor/ARCoreBuildProcessor.cs:280) UnityEditor.XR.ARCore.ARCorePreprocessBuild.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at /Volumes/Data Drive/OneDrive - S-One Holdings/Repos/Makers Mark/Android/Makers Mark/Library/PackageCache/com.unity.xr.arcore@2.1.0-preview.5/Editor/ARCoreBuildProcessor.cs:33) UnityEditor.Build.BuildPipelineInterfaces+cAnonStorey0.<>m1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:376) UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List1[T] oneInterfaces, System.Action1[T] invocationOne, System.Collections.Generic.List1[T] twoInterfaces, System.Action1[T] invocationTwo, System.Boolean exitOnFailure) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:356) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Building out to Android macOS Mojave 10.14.6 Beta (18G48f) Unity 2019.1.7f1 AR Foundation 2.2.0 preview.2 ARCore XR Plugin 2.1.0 preview.5

Has the fix been released yet?

nilsk123 commented 5 years ago

Does your project path have spaces in it? Seems like it, Markers Mark.

Try removing those spaces

tdmowrer commented 5 years ago

The spaces bug should have been fixed in 2.1.0.preview.5, which you are using. Does removing spaces from your path fix the issue?

jason268 commented 5 years ago

Hi @nilsk123 and @tdmowrer. I removed the spaces from the root folder name (screenshot below), but I'm still getting the error. Also, the demo files offered by Unity through Github give me the exact same error, so I know it's not just my project.

Screen Shot 2019-06-21 at 6 49 13 AM

nilsk123 commented 5 years ago

The spaces bug should have been fixed in 2.1.0.preview.5, which you are using. Does removing spaces from your path fix the issue?

ARFoundation 2.1.0.preview.5 is not appearing for me as an update in the package manager, unity 2019.1.8f1

preview 3 is the latest and still has this bug

jason268 commented 5 years ago

@nilsk123 I'm using preview.2 - 2.2.0. Does that version appear for you? If you click the left arrow twirl down next to the title "AR Foundation", you should see all of the versions available.

Screen Shot 2019-06-24 at 9 10 38 AM

nilsk123 commented 5 years ago

@nilsk123 I'm using preview.2 - 2.2.0. Does that version appear for you? If you click the left arrow twirl down next to the title "AR Foundation", you should see all of the versions available.

Screen Shot 2019-06-24 at 9 10 38 AM

It does, but that requires an xcode beta I think

baksarbed commented 5 years ago

My experience How I solve this problem.

I'm using Mac, Unity 2019.1.14f1 AR foundation 2.1.3, ARCore 2.2.0(preview)

I move the project to the /Users/{UserName}/UnityProject and it solves this problem for me.

But when trying to start the app it immediately close, the same problem was with this error. Only phone info show in adb

upd: when change configuration to зображення

it start work

HawkenKing commented 5 years ago

I'm also on mac, tried the settings above but got the error: Failed to generated ARCore reference image library

using Unity 2019.1.11f1 & arf 2.1.0

dorkbot commented 5 years ago

I get this issue sometimes. For me, moving the project to a file path that doesn't have any spaces fixes it. This bug comes and goes.

baksarbed commented 5 years ago

BTW: On Unity 2019.2.4f1 I have not any problem and don't need to move a project

dorkbot commented 5 years ago

For me, the issue came back after I updated. I updated to 2019.2.6f1, and also updated AR packages, so not sure what caused it to return, but now I have to move my project. Not the end of the world. Minor annoyance in my opinion.

tdmowrer commented 5 years ago

On macOS, the Unity package manager sets all files to readonly/non-executable, including the ARCore image generation executable. To fix this, we have to change its execution privileges by invoking chmod. This invocation does not currently account for spaces in the project path. You would see the image database generation fail with "Access denied" in this case. Is that what you're seeing?

Example error message:

Win32Exception: ApplicationName='/Users/timm/arfoundation/temp with spaces/ImageDatabase With Spaces/Packages/com.unity.xr.arcore/Tools~/MacOS/arcoreimg', CommandLine='build-db --input_image_list_path="/var/folders/jb/nk4yqqfj2h1c_xkx0s94gjtc0000gp/T/3f34576f6e404f519fd28efe6b80d2e2/da3be7447cb1468b83f10aebad839d38.txt" --output_db_path="/Users/timm/arfoundation/temp with spaces/ImageDatabase With Spaces/Assets/StreamingAssets/HiddenARCore/d161dff8-d19f-41a1-b2b4-1b1bd332814e.imgdb"', CurrentDirectory='', Native error= Access denied
SEdevo commented 5 years ago

Also having this issue on a mac. Unity3D 2019.2.9fi and ARFoundation 3.3, German country settings.

i did some logging and figured File doesn´t exist Documents/Unity3D/ExampleProjects/arfoundationstatue/Assets/StreamingAssets/HiddenARCore/ed172847-b888-4beb-a191-a2cb2a792cea.imgdb

Then it exits with Error:

Failed to generated ARCore reference image library 'imglibrary'

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

stdout:

====

stderr: Assets/statue/refereneimages/logo.png: Failed to get enough keypoints from target image.Failed to add some of the images to database.

UnityEditor.XR.ARCore.ARCorePreprocessBuild.BuildImageTrackingAssets () (at Library/PackageCache/com.unity.xr.arcore@3.0.0-preview.3/Editor/ARCoreBuildProcessor.cs:326) UnityEditor.XR.ARCore.ARCorePreprocessBuild.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.xr.arcore@3.0.0-preview.3/Editor/ARCoreBuildProcessor.cs:34) UnityEditor.Build.BuildPipelineInterfaces+cAnonStorey0.<>m1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:376) UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List1[T] oneInterfaces, System.Action1[T] invocationOne, System.Collections.Generic.List1[T] twoInterfaces, System.Action1[T] invocationTwo, System.Boolean exitOnFailure) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:356) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

After changing the image from an bw logo to photo it worked. in Unitys console this can easily be missed, as you have to read details

tdmowrer commented 5 years ago

Fixed in 3.0.0-preview.4

@SEdevo Thanks for reporting. That's a different issue (poor error reporting). I'll add an issue to our backlog to improve this in the future.

Marking this issue as closed.

SEdevo commented 5 years ago

Glad to be helpful!

anand3132 commented 5 years ago

Still, Exist mac os 10.14.5

Screenshot 2019-11-05 at 3 43 26 PM
SEdevo commented 5 years ago

look into "Output from arcoreimg" change consoles settings to view more lines or open the editor log.

anand3132 commented 5 years ago

in console only this much...adding editor log below Editor.log

SEdevo commented 5 years ago

yes. then find the line : "Assets/Textures/unitywhite.png: Failed to get enough keypoints from target image.Failed to add some of the images to database."

your image has not enough details.

anand3132 commented 5 years ago

thanks, it's fixed...need to check all reference image and its library before building

aidanwolf commented 5 years ago

Fix for me: make sure you don't have any empty ReferenceImageLibrary assets in your project

codemaker2015 commented 4 years ago

It's happened due to the low-quality score of the image. ARCore reference image library accepts images of type .png and .jpg only. Also, It shows to have a quality score. First, we have to check the quality score of the image using arcoreimg tool We can download it from arcoreimg Refer the following link to check the quality score click here If the quality score is greater than 10 then you can create a database using that image otherwise, try another one.

ARFoundation Reference Image Library Demo

SundharSS commented 3 years ago

The error is still there ...if our project name has space in it (eg. test project)..., during the build the reference image libraries are created outside the project folder(.imgdb and txt)....so I tried removing spaces...and it worked