Null Reference exception when game is played in android
See original GitHub issueDOES 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:
- Created 5 years ago
- Comments:15 (7 by maintainers)
Top GitHub Comments
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.
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.