amay077 / Xamarin.Forms.GoogleMaps

Map library for Xamarin.Forms using Google maps API
https://www.nuget.org/packages/Xamarin.Forms.GoogleMaps/
MIT License
546 stars 346 forks source link

System.NullReferenceException immediately upon the attempt of drawing the custom map pin (Forms Android) #683

Closed devcssbet closed 4 years ago

devcssbet commented 4 years ago

VERSIONS

PLATFORMS

ACTUAL BEHAVIOR

Crash with System.NullReferenceException after initiating the trace by route on the map.

ACTUAL SCREENSHOTS/STACKTRACE

UNHANDLED EXCEPTION: 12-19 16:13:03.040 I/MonoDroid(24556): System.NullReferenceException: Object reference not set to an instance of an object. 12-19 16:13:03.045 I/MonoDroid(24556): at Xamarin.Forms.GoogleMaps.Android.Utils+<>cDisplayClass2_0.b0 () [0x00038] in :0 12-19 16:13:03.045 I/MonoDroid(24556): at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs:534 12-19 16:13:03.045 I/MonoDroid(24556): at System.Threading.Tasks.Task.Execute () [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:2319 12-19 16:13:03.045 I/MonoDroid(24556): --- End of stack trace from previous location where exception was thrown --- 12-19 16:13:03.045 I/MonoDroid(24556): at Xamarin.Forms.GoogleMaps.Logics.Android.PinLogic.TransformXamarinViewToAndroidBitmap (Xamarin.Forms.GoogleMaps.Pin outerItem, Android.Gms.Maps.Model.Marker nativeItem) [0x0013b] in :0 12-19 16:13:03.045 I/MonoDroid(24556): at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b7_0 (System.Object state) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021 12-19 16:13:03.045 I/MonoDroid(24556): at Android.App.SyncContext+<>cDisplayClass2_0.b__0 () [0x00000] in <6e2e8fb437184994824f9a85bdfb3fcf>:0 12-19 16:13:03.045 I/MonoDroid(24556): at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <6e2e8fb437184994824f9a85bdfb3fcf>:0 12-19 16:13:03.045 I/MonoDroid(24556): at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr nativethis) [0x00009] in <6e2e8fb437184994824f9a85bdfb3fcf>:0 12-19 16:13:03.045 I/MonoDroid(24556): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.48(intptr,intptr) 12-19 16:13:03.070 W/art (24556): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable 12-19 16:13:03.075 D/Mono (24556): DllImport searching in: 'Internal' ('(null)'). 12-19 16:13:03.075 D/Mono (24556): Searching for 'java_interop_jnienv_throw'. 12-19 16:13:03.075 D/Mono (24556): Probing 'java_interop_jnienv_throw'. 12-19 16:13:03.075 D/Mono (24556): Found as 'java_interop_jnienv_throw'. System.NullReferenceException: 'Object reference not set to an instance of an object.'

EXPECTED BEHAVIOR

Custom pin of the source should trace the route of its movement towards the destination.

HOW TO REPRODUCE

  1. Download the sample package: https://github.com/rdelrosario/MapTrackingSample (not my own)
  2. Add the source route and the destination also
  3. It should crash immediately upon drawing the pin of the source vehicle
// code for reproduce
amay077 commented 4 years ago

I think you should understand MapTrackingSample and ask to https://github.com/rdelrosario/MapTrackingSample 's owner.