Bug 46370 - Bad magic number for Bundle in MapRenderer
Summary: Bad magic number for Bundle in MapRenderer
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.2.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-11-03 11:20 UTC by Dima
Modified: 2017-04-18 08:03 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Dima 2016-11-03 11:20:53 UTC
App crashes in Android MapRenderer with next message:
Bad magic number for Bundle: 0x35

I made some research and found this issue:
https://code.google.com/p/gmaps-api-issues/issues/detail?id=6237#c9

Although it's not Xamarin bug I will appreciate if you can fix it.

Device:
Samsung Galaxy 5, API 21 (it happens on other devices too)
Soft:
Xamarin 4.2.1.52
Xamarin Forms 2.2.0.31
Xamarin Forms Maps 1.5.1.6471
Xamarin.Android.Support.v4 23.3.0
Xamarin.GooglePlayServices.Maps v 27.0.0

Stack Trace:
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x93a59328 + 0x00024> in <filename unknown>:0 
  at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) <0xaf95c2f0 + 0x000af> in <filename unknown>:0 
  at Android.Runtime.JNIEnv.CallVoidMethod (IntPtr jobject, IntPtr jmethod, Android.Runtime.JValue* parms) <0xad51afa0 + 0x0006f> in <filename unknown>:0 
  at Android.Gms.Maps.MapView.OnCreate (Android.OS.Bundle savedInstanceState) <0x93a583e8 + 0x00137> in <filename unknown>:0 
  at Xamarin.Forms.Maps.Android.MapRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1 e) <0x96afb158 + 0x0009b> in <filename unknown>:0 
  at NegevSoft.MobileErp.MapViewRendererDroid.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1 e) <0x96afad78 + 0x00253> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (Xamarin.Forms.Platform.Android.TElement element) <0xad518130 + 0x0030f> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) <0xad517fb8 + 0x00063> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) <0xad515070 + 0x0007f> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, Boolean sameChildren) <0xa9361fb8 + 0x000af> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) <0xa9361760 + 0x0032b> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () <0xa9361658 + 0x0003b> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) <0xa93615f0 + 0x0002b> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (Xamarin.Forms.Platform.Android.TElement element) <0xad518130 + 0x00363> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) <0xad517fb8 + 0x00063> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) <0xad515070 + 0x0007f> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, Boolean sameChildren) <0xa9361fb8 + 0x000af> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) <0xa9361760 + 0x0032b> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () <0xa9361658 + 0x0003b> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) <0xa93615f0 + 0x0002b> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (Xamarin.Forms.Platform.Android.TElement element) <0xad518130 + 0x00363> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) <0xad517fb8 + 0x00063> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) <0xad515070 + 0x0007f> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, Boolean sameChildren) <0xa9361fb8 + 0x000af> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) <0xa9361760 + 0x0032b> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () <0xa9361658 + 0x0003b> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) <0xa93615f0 + 0x0002b> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (Xamarin.Forms.Platform.Android.TElement element) <0xad518130 + 0x00363> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) <0xad517fb8 + 0x00063> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Support.V4.App.FragmentManager fragmentManager) <0xa935ffd0 + 0x00177> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState) <0xa935fca8 + 0x00047> in <filename unknown>:0 
  at Android.Support.V4.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr native_inflater, IntPtr native_container, IntPtr native_savedInstanceState) <0xa935f9f0 + 0x000a3> in <filename unknown>:0 
  at (wrapper dynamic-method) System.Object:293294f3-cde4-4d80-ac68-a5a57b67c554 (intptr,intptr,intptr,intptr,intptr)
  --- End of managed exception stack trace ---
java.lang.IllegalStateException: Bad magic number for Bundle: 0x35
	at android.os.BaseBundle.readFromParcelInner(BaseBundle.java:1346)
	at android.os.BaseBundle.<init>(BaseBundle.java:90)
	at android.os.Bundle.<init>(Bundle.java:68)
	at android.os.Parcel.readBundle(Parcel.java:1698)
	at android.os.Parcel.readBundle(Parcel.java:1682)
	at android.support.v4.app.FragmentState.<init>(:com.google.android.gms.DynamiteModulesB:94)
	at ah.createFromParcel(:com.google.android.gms.DynamiteModulesB:2150)
	at android.os.Parcel.createTypedArray(Parcel.java:2068)
	at android.support.v4.app.FragmentManagerState.<init>(:com.google.android.gms.DynamiteModulesB:386)
	at ag.createFromParcel(:com.google.android.gms.DynamiteModulesB:2404)
	at android.os.Parcel.readParcelable(Parcel.java:2246)
	at android.os.Parcel.readValue(Parcel.java:2146)
	at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
	at android.os.BaseBundle.unparcel(BaseBundle.java:221)
	at android.os.Bundle.getBundle(Bundle.java:782)
	at aah.a(:com.google.android.gms.DynamiteModulesB:74)
	at maps.ad.t.a(Unknown Source)
	at maps.ad.R.a(Unknown Source)
	at wg.onTransact(:com.google.android.gms.DynamiteModulesB:66)
	at android.os.Binder.transact(Binder.java:395)
	at com.google.android.gms.maps.internal.IMapViewDelegate$zza$zza.onCreate(Unknown Source)
	at com.google.android.gms.maps.MapView$zza.onCreate(Unknown Source)
	at com.google.android.gms.dynamic.zza$3.zzb(Unknown Source)
	at com.google.android.gms.dynamic.zza$1.zza(Unknown Source)
	at com.google.android.gms.maps.MapView$zzb.zzxL(Unknown Source)
	at com.google.android.gms.maps.MapView$zzb.zza(Unknown Source)
	at com.google.android.gms.dynamic.zza.zza(Unknown Source)
	at com.google.android.gms.dynamic.zza.onCreate(Unknown Source)
	at com.google.android.gms.maps.MapView.onCreate(Unknown Source)
	at md5270abb39e60627f0f200893b490a1ade.FragmentContainer.n_onCreateView(Native Method)
	at md5270abb39e60627f0f200893b490a1ade.FragmentContainer.onCreateView(FragmentContainer.java:51)
	at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974)
	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
	at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742)
	at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
	at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:145)
	at android.app.ActivityThread.main(ActivityThread.java:5832)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Comment 1 Paul DiPietro [MSFT] 2017-03-03 15:45:16 UTC
This might take further investigation to see if it's something that can/should be handled on our end. I think that typically we try to avoid using hacks to work around bugs in Android itself unless absolutely necessary. Have you experienced this on specific versions of Android beyond what you initially mentioned?
Comment 2 Dima 2017-04-18 08:03:38 UTC
After updating Xamarin.GooglePlayServices.Maps to version 29.0 issue was not reproduced.