Topic: Android NullRef in Marker3D

Hi,

since yesterday I'm trying to solve an issue, but I'm at a loss here.

In Editor everything works fine, but when deploying to android I get this Exception (every tick, since it's in the update):

AndroidPlayer(ADB@127.0.0.1:34999) NullReferenceException: Object reference not set to an instance of an object.
  at OnlineMapsMarker3D.Update (UnityEngine.Bounds bounds, System.Double tlx, System.Double tly, System.Double brx, System.Double bry, System.Int32 zoom, System.Double ttlx, System.Double ttly, System.Double tbrx, System.Double tbry, System.Single bestYScale) [0x00000] in <00000000000000000000000000000000>:0
  at OnlineMapsMarker3DDrawer.Update3DMarkers () [0x00000] in <00000000000000000000000000000000>:0
  at OnlineMapsControlBase3D.UpdateControl () [0x00000] in <00000000000000000000000000000000>:0
  at OnlineMapsControlBaseDynamicMesh.UpdateControl () [0x00000] in <00000000000000000000000000000000>:0
  at OnlineMapsTileSetControl.UpdateControl () [0x00000] in <00000000000000000000000000000000>:0
  at OnlineMaps.CheckBufferComplete () [0x00000] in <00000000000000000000000000000000>:0
  at OnlineMaps.LateUpdate () [0x00000] in <00000000000000000000000000000000>:0

Unfortunately I couldn't figure out a way to get a better stacktrace.

I debugged a lot since then and the line of code it crashes is in
OnlineMapsMarker3D.Update -> Line 321 (if (instance == null) Init(control.marker3DManager.container))
Being called inside the PlayerLocation marker.

Debugging inside the Init method does not throw any exceptions.

I'm using Unity 2020.3 with the newest version of OnlineMaps v3 (updated yesterday).

Any help is much appreciated.
In case you have discord I can share my screen if this helps.

Thanks.

Re: Android NullRef in Marker3D

Hello.

Very interesting.
Please tell me more about your application.
I'm primarily interested in whether you create / disable / destroy the map object, how and when you create markers, and what you do in the application before this exception occurs.

Yes, we have a discord:
https://infinity-code.com/contacts

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

3 (edited by Lars Nonne 2021-03-19 07:56:51)

Re: Android NullRef in Marker3D

The app is a very small prototype. There is only a starting scene with some persistent objects, including the camera that is used in all scenes. The scene automatically loads the scene with the map in it. The map is already active and is never disabled. Same goes for all the markers. They are kept active (we just disable the visuals and intractability).
Markers are created with the Marker 3D Manager.

The exception occurs immediately after loading the scene.

I tried disabling and activating it shortly after loading the scene. That did resolve the issue at first, even when zooming IN, but as soon as I zoom OUT again, the exception is back and the map shows grey instead of the tiles (just like when the map is active from the beginning).

PS: I will have a look at discord once in a while to see if you are online there. But I'm from Germany, so our working hours probably differ quite a bit smile

Re: Android NullRef in Marker3D

I tested 3d markers on android yesterday and have no this exception.
If possible, please send a project that contains this issue by email (support@infinity-code.com).
I'll debug this.
To make it clear:
I don't need your working project. I need any temporary project where this problem is happening.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Android NullRef in Marker3D

Problem solved thanks to Alex.
Thanks again for the quick help with this.

My best guess is it was some issue in the execution order that only occured in some rare cases. He found it anyway. I probably never would have...