googlesamples / arcore-depth-lab

ARCore Depth Lab is a set of Depth API samples that provides assets using depth for advanced geometry-aware features in AR interaction and rendering. (UIST 2020)
https://augmentedperception.github.io/depthlab/
Apache License 2.0
780 stars 153 forks source link

Got Error when I tried to Build the master's code on my device( NullReferenceException) #32

Closed SaitoAsahi closed 2 years ago

SaitoAsahi commented 3 years ago

I got the issue below and I can't fix it for a long time..! How can I fix this?

I got this android's sample app code(master's one) from this page and tried to build on my android device. I imported ARCore-Extension Package using Package Manager. Thank you!

⑴ NullReferenceException: Object reference not set to an instance of an object Google.XR.ARCoreExtensions.Internal.RuntimeConfig+<>c.b__7_0 (UnityEngine.Object x) (at Library/PackageCache/com.google.ar.core.arfoundation.extensions@c3bc1636a644-1622675792614/Runtime/Scripts/Internal/RuntimeConfig.cs:79) ⑵ Error building Player: NullReferenceException: Object reference not set to an instance of an object ⑶ Build completed with a result of 'Failed' in 0 seconds (268 ms) UnityEditor.EditorApplication:Internal_CallGlobalEventHandler () (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:428) ⑷ UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002be] in /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:190 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:9 ⑸ Asset Packages/com.google.ar.core.arfoundation.extensions/Editor/BuildResources/DependenciesTempFolder has no meta file, but it's in an immutable folder. The asset will be ignored.
ruofeidu commented 3 years ago

Hi Asahi,

Sorry for the late reply.

Which Unity version are you using? We have tested the master branch with Unity 2020.3.6f1 and require AR Foundation 4.2.0-pre.7 or newer, ARCore Extensions 1.24 or newer.

If you want to try the new APIs, the master branch is the way to go; if you want to do research, I personally recommend you using the old branch for more demos.

AndrewGe commented 3 years ago

Hi Ruofeidu,

I am trying the master branch with Unity 2020.3.6f1 and AR Foundation 4.2.0-pre.7 and ARcore extention 1.24, I am getting the following error

ArgumentNullException: Value cannot be null. Parameter name: key System.Collections.Generic.Dictionary2[TKey,TValue].FindEntry (TKey key) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.Collections.Generic.Dictionary2[TKey,TValue].ContainsKey (TKey key) (at <695d1cc93cca45069c528c15c9fdd749>:0) DemoScenePreprocessBuild.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Assets/ARRealismDemos/Common/Scripts/Editor/DemoScenePreprocessBuild.cs:91) UnityEditor.Build.BuildPipelineInterfaces+<>c__DisplayClass15_0.b__1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:426) 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/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:406) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

I also tried Unity 2020.3.11f1, got similar errors too

ruofeidu commented 3 years ago

Hi Asahi,

What OS are you using?

My colleague tested on Mac after launch and I just tested on another Windows workstation (by changing manifest.json as instructed in README.md: both are working fantastically. Would you like do another clean clone and try again?

Cheers, Ruofei

AndrewGe commented 3 years ago

Hi Ruofeidu,

Here is what I did on MAC (1) git clone the master branch (2) change the manifest.json file to add ARCore Extensions SDK. Then opened it in Unity Hub with Unity 2020.3.6f1 (3) in "build and run", switch to Android (4) Build and run, got the error as attached

Screen Shot 2021-06-14 at 6 11 12 PM

The NullReferenceException is detailed below: NullReferenceException: Object reference not set to an instance of an object Google.XR.ARCoreExtensions.Internal.RuntimeConfig+<>c.b__7_0 (UnityEngine.Object x) (at Library/PackageCache/com.google.ar.core.arfoundation.extensions@47187a8d5087-1622159866879/Runtime/Scripts/Internal/RuntimeConfig.cs:79) System.Collections.Generic.List1[T].RemoveAll (System.Predicate1[T] match) (at <695d1cc93cca45069c528c15c9fdd749>:0)

thanura-Thrima commented 3 years ago

Hi Ruofeidu,

I'm having same error on windows 2020.3.12f1 unity version, It is possible to build , but when it comes to build and run it is getting same above error. btw, i can install build apk from manually and it works.

Regards, Raveen

mihirterna commented 3 years ago

Hi All,

I am also facing same issue while executing build and run method. Looking into same. Meanwhile, building only apk file works fine. Please try same.

Regards, Mihir

Zumbalamambo commented 3 years ago

@mihirterna I'm having the same problem now.

ruofeidu commented 3 years ago

Sorry for the late reply due to my recent moving vacations and federal holidays. I have personally tried both branches on Windows and Mac in Unity 2019.4 and 2020.3 respectively for the two branches and both builds work for me.

Honestly I never used build and run for the past year, but used our own script to build and adb install to my phone... I will try it next time with build and run, if anyone figures out the problem, please feel free to follow up.

ruofeidu commented 2 years ago

Let me know if you have any further error. Please use 2019.4.36f1 for legacy ARCore SDK and 2020.3 or above for the master branch.