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.

Unable to import a .glb file on Android

See original GitHub issue

Describe the bug

Hello there!

I’m trying to import a .glb file using the “Gltf asset” script with all option on default. No custom code.

It’s working fine on the editor, but on Android I’m getting the following :

2023/02/27 17:16:43.283 19335 19365 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2023/02/27 17:16:43.283 19335 19365 Error Unity at GLTFast.Materials.BuiltInMaterialGenerator.GenerateDefaultMaterial (System.Boolean pointsSupport) [0x00000] in <00000000000000000000000000000000>:0 2023/02/27 17:16:43.283 19335 19365 Error Unity at GLTFast.Materials.MaterialGenerator.GetDefaultMaterial (System.Boolean pointsSupport) [0x00000] in <00000000000000000000000000000000>:0 2023/02/27 17:16:43.283 19335 19365 Error Unity at GLTFast.GameObjectInstantiator.AddPrimitive (System.UInt32 nodeIndex, System.String meshName, UnityEngine.Mesh mesh, System.Int32[] materialIndices, System.UInt32[] joints, System.Nullable1[T] rootJoint, System.Single[] morphTargetWeights, System.Int32 primitiveNumeration) [0x00000] in <00000000000000000000000000000000>:0 2023/02/27 17:16:43.283 19335 19365 Error Unity at GLTFast.GltfImport+<>c__DisplayClass116_0.<InstantiateSceneInternal>g__PopulateHierarchy|2 (System.UInt32 nodeIndex, System.Nullable1[T] parentIndex) [0x00000] in <00000000000000000000000000000000>:0 2023/02/27 17:16:43.283 19335 19365 Error Unity at GLTFast.GltfImport+<>c__DisplayClass116_0.<InstantiateSceneInternal>g__IterateNodes|0 (System.UInt32 nodeI

The .GLB file in question is attached.

Unity 2022.2.2f1 Galaxy Tab S7 with Android 13

haha-63f797eb227eb(2).zip

I’ve also tried all the manual way to import a .GLB following the documentation, but they all end with the same error message.

Thanks !

Issue Analytics

  • State:open
  • Created 7 months ago
  • Reactions:2
  • Comments:20

github_iconTop GitHub Comments

1reaction
amrmohamed25commented, May 2, 2023

Sorry I haven’t been able to test it out since I created this issue, but I’m glad it’s working with this fix, thanks a lot 😃.

No problem at all. you are welcome 😃

1reaction
Creepymuldercommented, May 2, 2023

Sorry I haven’t been able to test it out since I created this issue, but I’m glad it’s working with this fix, thanks a lot 😃.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can not load .glb file on Android device. · Issue #117
I put my .glb files on http server, and download on android's Application.persistentPath. the file can download and store successfully, but when ...
Read more >
loading glb file failed while using filament android for 3d
Hi I am trying to load a glb file in my android app for 3d view. I found about android filament and tried...
Read more >
Failed to import previously exported project file (glb)
If the saved project works but the export fails, then it means you got this 100Mb limit. You can find the saved project...
Read more >
Starting out. Can't import .glb files : r/blenderhelp
I'm trying to import some files from alt1, which is a programme used to create addons for Runescape 3, and also has a...
Read more >
Unable to load GLTF model in android release mode, but ...
importing a .glb file fails if only local path is provided and not served through HTTP. opened 12:55PM - 01 Mar 21 UTC....
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