Bug 42347 - Issues with tabbedpage and map
Summary: Issues with tabbedpage and map
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2016-07-04 16:57 UTC by Jean
Modified: 2016-07-10 12:02 UTC (History)
1 user (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 Jean 2016-07-04 16:57:15 UTC
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Configuration android.content.res.Resources.getConfiguration()' on a null object reference
	at android.util.ResolutionOverride.<init>(ResolutionOverride.java:56)
	at android.view.SurfaceView.init(SurfaceView.java:207)
	at android.view.SurfaceView.<init>(SurfaceView.java:187)
	at maps.X.x.<init>(Unknown Source)
	at maps.X.v.<init>(Unknown Source)
	at maps.E.u.<init>(Unknown Source)
	at maps.E.u.a(Unknown Source)
	at maps.af.ad.a(Unknown Source)
	at maps.af.t.a(Unknown Source)
	at maps.af.Q.a(Unknown Source)
	at vz.onTransact(:com.google.android.gms.DynamiteModulesB:66)
	at android.os.Binder.transact(Binder.java:387)
	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.zzzW(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.executePendingTransactions(FragmentManager.java:570)
	at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
	at android.support.v4.view.ViewPager.populate(ViewPager.java:1177)
	at android.support.v4.view.ViewPager.populate(ViewPager.java:1025)
	at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1545)
	at android.view.View.measure(View.java:18810)
	at md5270abb39e60627f0f200893b490a1ade.TabbedPageRenderer.n_onLayout(Native Method)
	at md5270abb39e60627f0f200893b490a1ade.TabbedPageRenderer.onLayout(TabbedPageRenderer.java:71)
	at android.view.View.layout(View.java:16652)
	at android.view.ViewGroup.layout(ViewGroup.java:5438)
	at com.xamarin.forms.platform.android.FormsViewGroup.measureAndLayout(FormsViewGroup.java:29)
	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.PlatformRenderer.n_onLayout(Native Method)
	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.PlatformRenderer.onLayout(PlatformRenderer.java:55)
	at android.view.View.layout(View.java:16652)
	at android.view.ViewGroup.layout(ViewGroup.java:5438)
	at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1080)
	at android.view.View.layout(View.java:16652)
	at android.view.ViewGroup.layout(ViewGroup.java:5438)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
	at android.view.View.layout(View.java:16652)
	at android.view.ViewGroup.layout(ViewGroup.java:5438)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
	at android.view.View.layout(View.java:16652)
	at android.view.ViewGroup.layout(ViewGroup.java:5438)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
	at android.view.View.layout(View.java:16652)
	at android.view.ViewGroup.layout(ViewGroup.java:5438)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
	at android.view.View.layout(View.java:16652)
	at android.view.ViewGroup.layout(ViewGroup.java:5438)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
	at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678)
	at android.view.View.layout(View.java:16652)
	at android.view.ViewGroup.layout(ViewGroup.java:5438)
	at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2176)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1936)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1112)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6035)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
	at android.view.Choreographer.doCallbacks(Choreographer.java:670)
	at android.view.Choreographer.doFrame(Choreographer.java:606)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:148)
	at android.app.ActivityThread.main(ActivityThread.java:5451)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)



Another one:


java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Configuration android.content.res.Resources.getConfiguration()' on a null object reference
	at android.util.ResolutionOverride.<init>(ResolutionOverride.java:56)
	at android.view.SurfaceView.init(SurfaceView.java:207)
	at android.view.SurfaceView.<init>(SurfaceView.java:187)
	at maps.X.x.<init>(Unknown Source)
	at maps.X.v.<init>(Unknown Source)
	at maps.E.u.<init>(Unknown Source)
	at maps.E.u.a(Unknown Source)
	at maps.ag.ad.a(Unknown Source)
	at maps.ag.t.a(Unknown Source)
	at maps.ag.Q.a(Unknown Source)
	at vn.onTransact(:com.google.android.gms.DynamiteModulesB:66)
	at android.os.Binder.transact(Binder.java:387)
	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.zzzW(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.executePendingTransactions(FragmentManager.java:570)
	at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
	at android.support.v4.view.ViewPager.populate(ViewPager.java:1177)
	at android.support.v4.view.ViewPager.populate(ViewPager.java:1025)
	at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1545)
	at android.view.View.measure(View.java:18866)
	at md5270abb39e60627f0f200893b490a1ade.TabbedPageRenderer.n_onLayout(Native Method)
	at md5270abb39e60627f0f200893b490a1ade.TabbedPageRenderer.onLayout(TabbedPageRenderer.java:71)
	at android.view.View.layout(View.java:16708)
	at android.view.ViewGroup.layout(ViewGroup.java:5437)
	at com.xamarin.forms.platform.android.FormsViewGroup.measureAndLayout(FormsViewGroup.java:29)
	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.PlatformRenderer.n_onLayout(Native Method)
	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.PlatformRenderer.onLayout(PlatformRenderer.java:55)
	at android.view.View.layout(View.java:16708)
	at android.view.ViewGroup.layout(ViewGroup.java:5437)
	at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
	at android.view.View.layout(View.java:16708)
	at android.view.ViewGroup.layout(ViewGroup.java:5437)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
	at android.view.View.layout(View.java:16708)
	at android.view.ViewGroup.layout(ViewGroup.java:5437)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
	at android.view.View.layout(View.java:16708)
	at android.view.ViewGroup.layout(ViewGroup.java:5437)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
	at android.view.View.layout(View.java:16708)
	at android.view.ViewGroup.layout(ViewGroup.java:5437)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
	at android.view.View.layout(View.java:16708)
	at android.view.ViewGroup.layout(ViewGroup.java:5437)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
	at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2685)
	at android.view.View.layout(View.java:16708)
	at android.view.ViewGroup.layout(ViewGroup.java:5437)
	at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2175)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1935)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1111)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6017)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
	at android.view.Choreographer.doCallbacks(Choreographer.java:670)
	at android.view.Choreographer.doFrame(Choreographer.java:606)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:224)
	at android.app.ActivityThread.main(ActivityThread.java:5514)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Comment 1 Jonathan Pryor 2016-07-04 18:08:32 UTC
Those stack traces are all buried within Android View code or Google Maps code. This is either indicative of a bug in their code, or the Maps component is being "misconfigured".

Perhaps it's this bug?

https://code.google.com/p/gmaps-api-issues/issues/detail?id=9071

Or anything else mentioned here?

https://www.google.com/search?q=NullPointerException+android.util.ResolutionOverride
Comment 2 Jean 2016-07-05 03:49:40 UTC
Yes it looks similar to this one:
https://github.com/lelandrichardson/react-native-maps/issues/165

However in't android.support.v4.view.ViewPager part of Xamarin android libraries? Should not the exception be catched?
Comment 3 Jonathan Pryor 2016-07-06 15:04:44 UTC
android.support.v4.view.ViewPager is part of the Android Support Library:

https://components.xamarin.com/view/xamandroidsupportv4-18

> Should not the exception be catched?

Why should it be caught? Java code threw the exception, so the exception was marshaled and re-thrown.
Comment 4 Jean 2016-07-06 17:09:13 UTC
Are you kidding? Why?

Maybe because there is NO way for the developer to catch it AND it CRASHES the app! (except if I have missed something?)

So yes, it should be caught!
Or provide a way to catch/handle it because users don't care what happened, they only see an app crashing with no explanation, and it is very bad.

At least Windows has the global unhandleexception handler.
Comment 5 Jonathan Pryor 2016-07-06 17:18:26 UTC
Xamarin.Android is a *binding* of the Android API, not a "reimplementation". If Android does something phenomenally stupid, well, then so will Xamarin.Android apps, because they're all the same.

Doing the same thing in Java will result in the same behavior: an uncatchable exception that crashes the app.

This is *desirable*, at least from my perspective, as every "behavioral change" from Java means something that needs to be documented, considered in bug reports, and just complicates everything. (*Non*-behavioral changes, such as property generation and event generation, already add a fair bit of "changes" over Java which complicate documentation and porting...)

> At least Windows has the global unhandleexception handler.

Java has Java.Lang.Thread.DefaultUncaughtExceptionHandler [0], but this only allows you to be notified when there is an uncaught exception, not "handle" it and prevent the unhandled exception from tearing down your app.

If you want such a feature, you should ask Google to add it to Android.

[0]: https://developer.xamarin.com/api/property/Java.Lang.Thread.DefaultUncaughtExceptionHandler/
Comment 6 Jean 2016-07-10 12:02:50 UTC
:(
Even if I understand the reasons why Xamarin does not change the behavior, I think it would be nice to propose the option...