question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Oculus Quest (Android) ArgumentNullException: Value cannot be null

See original GitHub issue

I’m having an issue with GTLFUtility’s runtime importing on the Oculus Quest. Works great on Mac/Windows and I’m loving the lightweight approach vs other GLTF Importer options.

I’m not entirely sure if this is a issue with the package or user error, but figured I’d send up the logs in hopes of some help.

I’m currently building on Windows 10 using Unity 2019.2.9f1

Logs:

AndroidPlayer(ADB@127.0.0.1:34999) ArgumentNullException: Value cannot be null.
Parameter name: shader
  at (wrapper managed-to-native) UnityEngine.Material.CreateWithShader(UnityEngine.Material,UnityEngine.Shader)
  at UnityEngine.Material..ctor (UnityEngine.Shader shader) [0x00009] in /Users/builduser/buildslave/unity/build/Runtime/Export/Shaders/Shader.bindings.cs:118 
  at Siccity.GLTFUtility.GLTFMaterial+PbrMetalRoughness.CreateMaterial (Siccity.GLTFUtility.GLTFTexture+ImportResult[] textures, Siccity.GLTFUtility.AlphaMode alphaMode, Siccity.GLTFUtility.ShaderSettings shaderSettings) [0x00043] in D:\PROJECTS\git\TestProject\Assets\GLTFUtility\Scripts\Spec\GLTFMaterial.cs:109 
  at Siccity.GLTFUtility.GLTFMaterial.CreateMaterial (Siccity.GLTFUtility.GLTFTexture+ImportResult[] textures, Siccity.GLTFUtility.ShaderSettings shaderSettings) [0x0000f] in D:\PROJECTS\git\TestProject\Assets\GLTFUtility\Scripts\Spec\GLTFMaterial.cs:39 
  at Siccity.GLTFUtility.GLTFMaterial+ImportTask.OnMainThreadFinalize () [0x00028] in D:\PROJECTS\git\TestProject\Assets\GLTFUtility\Scripts\Spec\GLTFMaterial.cs:225 
  at Siccity.GLTFUtility.Importer+ImportTask`1[TReturn].RunSynchronously () [0x0000d] in D:\PROJECTS\git\TestProject\Assets\GLTFUtility\Scripts\Importer.cs:96 
  at Siccity.GLTFUtility.Importer.LoadInternal (Siccity.GLTFUtility.GLTFObject gltfObject, System.String filepath, Siccity.GLTFUtility.ImportSettings importSettings, Siccity.GLTFUtility.GLTFAnimation+ImportResult[]& animations) [0x00091] in D:\PROJECTS\git\TestProject\Assets\GLTFUtility\Scripts\Importer.cs:138 
  at Siccity.GLTFUtility.Importer.ImportGLTF (System.String filepath, Siccity.GLTFUtility.ImportSettings importSettings, Siccity.GLTFUtility.GLTFAnimation+ImportResult[]& animations) [0x0000f] in D:\PROJECTS\git\TestProject\Assets\GLTFUtility\Scripts\Importer.cs:77 
  at Siccity.GLTFUtility.Importer.LoadFromFile (System.String filepath, Siccity.GLTFUtility.ImportSettings importSettings, Siccity.GLTFUtility.GLTFAnimation+ImportResult[]& animations, Siccity.GLTFUtility.Format format) [0x00063] in D:\PROJECTS\git\TestProject\Assets\GLTFUtility\Scripts\Importer.cs:32 
  at Siccity.GLTFUtility.Importer.LoadFromFile (System.String filepath, Siccity.GLTFUtility.ImportSettings importSettings, Siccity.GLTFUtility.Format format) [0x00001] in D:\PROJECTS\git\TestProject\Assets\GLTFUtility\Scripts\Importer.cs:21 
  at FileManager.LoadModelWithGLTFUtility (TestNamespace.File file, System.Action`1[T] callback) [0x0003d] in D:\PROJECTS\git\TestProject\Assets\Scripts\Classes\FileManager.cs:67 
  at TestObject.DownloadModelIfNeeded (TestNamespace.InteractableState state) [0x0005c] in D:\PROJECTS\git\TestProject\Assets\Scripts\TestObject.cs:258 
  at TestObject.UpdateObject () [0x00070] in D:\PROJECTS\git\TestProject\Assets\Scripts\TestObject.cs:213 
  at UXSessionManager.UpdateObjectInScene (TestNamespace.BaseData objectData) [0x0008c] in D:\PROJECTS\git\TestProject\Assets\UXFoundation\UXManagers\UXSessionManager.cs:256 
  at UXSessionManager.ListenForDataUpdate (System.Object value) [0x00008] in D:\PROJECTS\git\TestProject\Assets\UXFoundation\UXManagers\UXSessionManager.cs:222 
  at UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) [0x00018] in /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent/UnityEvent.cs:207 
  at UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) [0x00025] in /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent/UnityEvent/UnityEvent_1.cs:58 
  at EventManager.Trigger (System.String eventName, System.Object value) [0x00015] in D:\PROJECTS\git\TestProject\Assets\Scripts\Classes\EventManager.cs:39 
  at TestNamespace.BaseData.SendUpdate () [0x00001] in D:\PROJECTS\git\TestProject\Assets\Scripts\Classes\Data\BaseData.cs:60 
  at UXSession.CreateDownloadedObject (TestNamespace.File file, System.String type) [0x000c2] in D:\PROJECTS\git\TestProject\Assets\UXFoundation\UXData\UXSession.cs:100 
  at ObjectsController+<>c__DisplayClass10_2.<OnEnable>b__0 () [0x00001] in D:\PROJECTS\git\TestProject\Assets\Scripts\UI\Controllers\ObjectsController.cs:149 
  at UnityEngine.Events.InvokableCall.Invoke () [0x00017] in /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent/UnityEvent.cs:166 
  at UnityEngine.Events.UnityEvent.Invoke () [0x00024] in /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent/UnityEvent/UnityEvent_0.cs:58 
  at UnityEngine.UI.Button.Press () [0x00027] in D:\Unity\2019.2.9f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\Button.cs:68 
  at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00010] in D:\Unity\2019.2.9f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\Button.cs:110 
  at UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00001] in D:\Unity\2019.2.9f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\ExecuteEvents.cs:50 
  at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) [0x0006c] in D:\Unity\2019.2.9f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\ExecuteEvents.cs:261 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) (at D:\Unity\2019.2.9f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\ExecuteEvents.cs:265)
VRPointerInputModule:ProcessRelease(PointerEventData) (at D:\PROJECTS\git\TestProject\Assets\Scripts\VRPointerInputModule.cs:175)
VRPointerInputModule:Process() (at D:\PROJECTS\git\TestProject\Assets\Scripts\VRPointerInputModule.cs:86)
UnityEngine.EventSystems.EventSystem:Update() (at D:\Unity\2019.2.9f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\EventSystem.cs:377)
 
(Filename: /Users/builduser/buildslave/unity/build/Runtime/Export/Shaders/Shader.bindings.cs Line: 118)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
InnoLukecommented, Sep 28, 2020

I was having the same issue, but as a Unity noob it took me a while to figure out how to add the GLTFUtility to the Always Included Shader List. Here’s my guide:

Open Edit -> Project Settings Open Graphics Scroll to Always Included Shaders Under Size, increase the value by 4 and hit Enter. In the Project panel, navigate to Packages/GLTFUtility/Materials/Built-in. In this directory are 4 .shader files. Drag and drop each of the 4 files into one of the 4 newly created rows in Always Included Shaders.

Hope this helps someone in future!

2reactions
sbancacommented, Jan 3, 2020

I was also incurring on a similar problem using GLTFUtility + Oculus Quest

01-03 13:15:15.259 26901 26919 E Unity : ArgumentNullException: Value cannot be null. 01-03 13:15:15.259 26901 26919 E Unity : Parameter name: shader 01-03 13:15:15.259 26901 26919 E Unity : at (wrapper managed-to-native) UnityEngine.Material.CreateWithShader(UnityEngine.Material,UnityEngine.Shader) 01-03 13:15:15.259 26901 26919 E Unity : at UnityEngine.Material..ctor (UnityEngine.Shader shader) [0x00007] in <6084548bc46840b9ba4aa48ad550def0>:0 01-03 13:15:15.259 26901 26919 E Unity : at Siccity.GLTFUtility.GLTFMaterial+PbrMetalRoughness.CreateMaterial (Siccity.GLTFUtility.GLTFTexture+ImportResult[] textures, Siccity.GLTFUtility.AlphaMode alphaMode, Siccity.GLTFUtility.ShaderSettings shaderSettings) [0x0001f] in <3e7525f864284e13ac2d1a094431aea0>:0 01-03 13:15:15.259 26901 26919 E Unity : at Siccity.GLTFUtility.GLTFMaterial.CreateMaterial (Siccity.GLTFUtility.GLTFTexture+ImportResult[] textures, Siccity.GLTFUtility.ShaderSettings shaderSettings) [0x00008] in <3e7525f864284e13ac2d1a094431aea0>:0 01-03 13:15:15.259 26901 26919 E Unity : at Siccity.GLTFUtility.GLTFMaterial+ImportTask.OnMainThreadFinalize () [0x0002e] in <3e7525f864284e13ac2d1a094431aea0>:0 01-03 13:15:15.259 26901 26919 E Unity : at Siccity.GLTFUtility.Importer+ImportTask1[TReturn].RunSynchronously () [0x0000b] in <3e7525f864284e13ac2d1a094431aea0>`

Including the GLTFUtility shaders on the always included Shader list in unity fixed the problem.

Siccity thumbs up for GLTFUtility

Read more comments on GitHub >

github_iconTop Results From Across the Web

Value cannot be null. Parameter name: dest - Unity Forum
I don't know what "ArgumentNullException: Value cannot be null. Parameter name: dest" means or how to fix it but my scene won't render....
Read more >
How to fix the name: Null (4585) on Oculus quest 2??
I need anyone to help. When I tap on my oculus account it says ( Error try again later) and when I go...
Read more >
OVRPlayerController Problem - ArgumentNullExceptio...
I updated my Oculus software and Unity integration scripts and my Unity VR ... OVRPlayerController Problem - ArgumentNullException: Argument cannot be null.
Read more >
Unity build error "Value cannot be null. Parameter name
I'm getting this error when trying to build my game for Android, ... Error building Player: ArgumentNullException: Value cannot be null.
Read more >
Obi Official Forum - Obi Fluid
Go to first unread post Bug / Crash After update I get "ArgumentNullException: Value cannot be null" · emz06.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found