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.

Null Reference exception when game is played in android

See original GitHub issue

DOES YOUR FRAMEWORK WORKS FOR ANDROID BUILDS?

I am using ezyslice in my android game and it runs fine when using unity editor but it doesn’t work when I make a build and runs it into null reference exceptions as given below

1.)AndroidPlayer(ADB@127.0.0.1:34999) NullReferenceException: Object reference not set to an instance of an object at EzySlice.Intersector.Intersect (Plane pl, Triangle tri, EzySlice.IntersectionResult& result) [0x00003] in C:\Users\Mani\Documents\BeatSaberCloneMobile\Assets\3rd-Party\EzySlice-fbb271fad6762b7a81c18f4bba19bdd59defbfca\EzySlice\Framework\Intersector.cs:60 at EzySlice.Triangle.Split (Plane pl, EzySlice.IntersectionResult result) [0x0000a] in C:\Users\Mani\Documents\BeatSaberCloneMobile\Assets\3rd-Party\EzySlice-fbb271fad6762b7a81c18f4bba19bdd59defbfca\EzySlice\Framework\Triangle.cs:308


2.)AndroidPlayer(ADB@127.0.0.1:34999) NullReferenceException: Object reference not set to an instance of an object at EzySlice.Intersector.Intersect (Plane pl, Triangle tri, EzySlice.IntersectionResult& result) [0x00003] in C:\Users\Mani\Documents\BeatSaberCloneMobile\Assets\3rd-Party\EzySlice-master\EzySlice\Framework\Intersector.cs:60 at EzySlice.Triangle.Split (Plane pl, EzySlice.IntersectionResult result) [0x0000a] in C:\Users\Mani\Documents\BeatSaberCloneMobile\Assets\3rd-Party\EzySlice-master\EzySlice\Framework\Triangle.cs:308 at EzySlice.Slicer.Slice (UnityEngine.Mesh sharedMesh, Plane pl, TextureRegion region, Int32 crossIndex) [0x0018d] in C:\Users\Mani\Documents\BeatSaberCloneMobile\Assets\3rd-Party\EzySlice-master\EzySlice\Slicer.cs:194 at EzySlice.Slicer.Slice (UnityEngine.GameObject obj, Plane pl, TextureRegion crossRegion, UnityEngine.Material crossMaterial) [0x000e9] in C:\Users\Mani\Documents\BeatSaberCloneMobile\Assets\3rd-Party\EzySlice-master\EzySlice\Slicer.cs:124 at EzySlice.SlicerExtensions.Slice (UnityEngine.GameObject obj, Plane pl, TextureRegion textureRegion, UnityEngine.Material crossSectionMaterial) [0x00005] in C:\Users\Mani\Documents\BeatSaberCloneMobile\Assets\3rd-Party\EzySlice-master\EzySlice\SlicerExtensions.cs:33 at EzySlice.SlicerExtensions.Slice (UnityEngine.GameObject obj, Vector3 position, Vector3 direction, TextureRegion textureRegion, UnityEngine.Material crossSectionMaterial) [0x00027] in C:\Users\Mani\Documents\BeatSaberCloneMobile\Assets\3rd-Party\EzySlice-master\EzySlice\SlicerExtensions.cs:27 at EzySlice.SlicerExtensions.Slice (UnityEngine.GameObject obj, Vector3 position, Vector3 direction, UnityEngine.Material crossSectionMaterial) [0x0001e] in C:\Users\Mani\Documents\BeatSaberCloneMobile\Assets\3rd-Party\EzySlice-master\EzySlice\SlicerExtensions.cs:18 at SlicerRealTimeMod.SliceObject (UnityEngine.GameObject obj, UnityEngine.Material crossSectionMaterial) [0x00019] in C:\Users\Mani\Documents\BeatSaberCloneMobile\Assets\Scripts\ImportedScripts\SlicerRealTimeMod.cs:25 at ShellCreator+<shellCreator>c__Iterator0.MoveNext () [0x00035] in C:\Users\Mani\Documents\BeatSaberCloneMobile\Assets\Scripts\ShellCreator.cs:41 at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00028] in /Users/builduser/buildslave/unity/build/Runtime/Export/Coroutines.cs:17 UnityEngine.MonoBehaviour:StartCoroutine_Auto_Internal(IEnumerator) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/MonoBehaviourBindings.gen.cs:63) ShellCreator:startShellCreator(GameObject) (at C:\Users\Mani\Documents\BeatSaberCloneMobile\Assets\Scripts\ShellCreator.cs:37) SourceCubeController:OnPointerExit(PointerEventData) (at C:\Users\Mani\Documents\BeatSaberCloneMobile\Assets\Scripts\SourceCubeController.cs:64) UnityEngine.EventSystems.ExecuteEvents:Execute(IPointerExitHandler, BaseEventData) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\ExecuteEvents.cs:29) UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\ExecuteEvents.cs:261) UnityEngine.EventSystems.BaseInputModule:HandlePointerExitAndEnter(PointerEventData, GameObject) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\BaseInputModule.cs:136) UnityEngine.EventSystems.PointerInputModule:ProcessMove(PointerEventData) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\PointerInputModule.cs:248) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\StandaloneInputModule.cs:232) UnityEngine.EventSystems.StandaloneInputModule:Process() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\StandaloneInputModule.cs:211) UnityEngine.EventSystems.EventSystem:Update() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\EventSystem.cs:294)

(Filename: C Line: 0)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
DavidArayancommented, Apr 12, 2018

Greetings,

Thank you for the information. I’ll continue digging. I have a suspicion that it may have something to do with the “ref” keyword, which is redundant considering IntersectionResult is a class. It’s likely left over from when I changed IntersectionResult from a struct into a class. I’ll write back once I’ve got a tested fix.

0reactions
DavidArayancommented, May 19, 2018

Unfortunately that seems to be the case nemesiscy, for the moment anyway. I’ll look into this issue a bit further when time permits, I hate guesstimating when it comes down to code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Null Reference Exception error occurs when trying to ...
I followed the docs from here, about Overriding the Android Manifest. The apk builds fine when the manifest is removed. Complete Error:.
Read more >
Running MonoGame with Microsoft.Android Game ...
Android, the program crashes on the Game1 class constructor. Null reference exception. image. Was wondering if anyone has been playing with ...
Read more >
I'm getting a null reference exception ONLY on google play ...
Basics of it are, I have a button in my game that instantiates a physics object. This feature has worked perfectly fine for...
Read more >
Game is working fine in editor but getting a null reference ...
I am using this slice framework in my game 1 and it is working fine in editor but when i built a development...
Read more >
c# - How to find out which object reference is null, when an ...
I have a published game with Crashlytics, that run on Android and iOS. I have records of "Object reference not set to an...
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