Bug 44721 - BindableObject.GetContext(BindableProperty property) NullReferenceException
Summary: BindableObject.GetContext(BindableProperty property) NullReferenceException
Status: RESOLVED NORESPONSE
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.2
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-09-25 15:36 UTC by Kirill
Modified: 2017-05-31 17:12 UTC (History)
3 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 NORESPONSE

Description Kirill 2016-09-25 15:36:48 UTC
Hello. This error is thrown if I change page when UpdateLayout is in process. 

I often see this error when I change detail page in MasterDetailPage. 
Maybe I changed BindableProperty in second thread. Must I change BindableProperty of View in MainThread?

I don't always get this error. But error is thrown in ultimately.

Can you help me?
Comment 1 Kirill 2016-09-25 15:37:08 UTC
Xamarin caused by: android.runtime.JavaProxyThrowable: System.NullReferenceException: Object reference not set to an instance of an object
Xamarin.Forms.BindableObject.GetContext(BindableProperty property)<b0fc14d4e5b04749b7241d1235a68329>:0
Xamarin.Forms.BindableObject.GetValue(BindableProperty property)<b0fc14d4e5b04749b7241d1235a68329>:0
Xamarin.Forms.VisualElement.get_Width()<b0fc14d4e5b04749b7241d1235a68329>:0
Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateAnchorX()<95895bcb439e42ebb8e7134a545f1acc>:0
Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout()<95895bcb439e42ebb8e7134a545f1acc>:0
Xamarin.Forms.Platform.Android.VisualElementRenderer<TElement>.UpdateLayout()<95895bcb439e42ebb8e7134a545f1acc>:0
Xamarin.Forms.Platform.Android.VisualElementRenderer<TElement>.OnLayout(bool changed, int l, int t, int r, int b)<95895bcb439e42ebb8e7134a545f1acc>:0
Xamarin.Forms.Platform.Android.ViewRenderer<TView, TNativeView>.OnLayout(bool changed, int l, int t, int r, int b)<95895bcb439e42ebb8e7134a545f1acc>:0
Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII(IntPtr jnienv, IntPtr native__this, bool p0, int p1, int p2, int p3, int p4)<2727d869763141fbae32189add254e74>:0
at (wrapper dynamic-method) System.Object:6d762c2f-39e9-4d3d-a4ef-f546fa735398 (intptr,intptr,bool,int,int,int,int)
md5b60ffeb829f638581ab2bb9b1a7f4f3f.ViewRenderer_2.n_onLayout(Native Method)
md5b60ffeb829f638581ab2bb9b1a7f4f3f.ViewRenderer_2.onLayout()ViewRenderer_2.java:47
android.view.View.layout()View.java:16695
android.view.ViewGroup.layout()ViewGroup.java:5328
com.xamarin.forms.platform.android.FormsViewGroup.measureAndLayout()FormsViewGroup.java:29
md5b60ffeb829f638581ab2bb9b1a7f4f3f.VisualElementRenderer_1.n_onLayout(Native Method)
md5b60ffeb829f638581ab2bb9b1a7f4f3f.VisualElementRenderer_1.onLayout()VisualElementRenderer_1.java:49
android.view.View.layout()View.java:16695
android.view.ViewGroup.layout()ViewGroup.java:5328
com.xamarin.forms.platform.android.FormsViewGroup.measureAndLayout()FormsViewGroup.java:29
md5b60ffeb829f638581ab2bb9b1a7f4f3f.PageContainer.n_onLayout(Native Method)
md5b60ffeb829f638581ab2bb9b1a7f4f3f.PageContainer.onLayout()PageContainer.java:46
android.view.View.layout()View.java:16695
android.view.ViewGroup.layout()ViewGroup.java:5328
md5270abb39e60627f0f200893b490a1ade.NavigationPageRenderer.n_onLayout(Native Method)
md5270abb39e60627f0f200893b490a1ade.NavigationPageRenderer.onLayout()NavigationPageRenderer.java:63
android.view.View.layout()View.java:16695
android.view.ViewGroup.layout()ViewGroup.java:5328
com.xamarin.forms.platform.android.FormsViewGroup.measureAndLayout()FormsViewGroup.java:29
md5270abb39e60627f0f200893b490a1ade.MasterDetailContainer.n_onLayout(Native Method)
md5270abb39e60627f0f200893b490a1ade.MasterDetailContainer.onLayout()MasterDetailContainer.java:45
android.view.View.layout()View.java:16695
android.view.ViewGroup.layout()ViewGroup.java:5328
android.support.v4.widget.DrawerLayout.onLayout()DrawerLayout.java:1187
md5270abb39e60627f0f200893b490a1ade.MasterDetailPageRenderer.n_onLayout(Native Method)
md5270abb39e60627f0f200893b490a1ade.MasterDetailPageRenderer.onLayout()MasterDetailPageRenderer.java:68
android.view.View.layout()View.java:16695
android.view.ViewGroup.layout()ViewGroup.java:5328
md5b60ffeb829f638581ab2bb9b1a7f4f3f.PlatformRenderer.n_onLayout(Native Method)
md5b60ffeb829f638581ab2bb9b1a7f4f3f.PlatformRenderer.onLayout()PlatformRenderer.java:55
android.view.View.layout()View.java:16695
android.view.ViewGroup.layout()ViewGroup.java:5328
android.widget.RelativeLayout.onLayout()RelativeLayout.java:1077
android.view.View.layout()View.java:16695
android.view.ViewGroup.layout()ViewGroup.java:5328
android.widget.FrameLayout.layoutChildren()FrameLayout.java:573
android.widget.FrameLayout.onLayout()FrameLayout.java:508
android.view.View.layout()View.java:16695
android.view.ViewGroup.layout()ViewGroup.java:5328
android.widget.LinearLayout.setChildFrame()LinearLayout.java:1702
android.widget.LinearLayout.layoutVertical()LinearLayout.java:1556
android.widget.LinearLayout.onLayout()LinearLayout.java:1465
android.view.View.layout()View.java:16695
android.view.ViewGroup.layout()ViewGroup.java:5328
android.widget.FrameLayout.layoutChildren()FrameLayout.java:573
android.widget.FrameLayout.onLayout()FrameLayout.java:508
android.view.View.layout()View.java:16695
android.view.ViewGroup.layout()ViewGroup.java:5328
android.view.ViewRootImpl.performLayout()ViewRootImpl.java:2319
android.view.ViewRootImpl.performTraversals()ViewRootImpl.java:2032
android.view.ViewRootImpl.doTraversal()ViewRootImpl.java:1191
android.view.ViewRootImpl$TraversalRunnable.run()ViewRootImpl.java:6642
android.view.Choreographer$CallbackRecord.run()Choreographer.java:777
android.view.Choreographer.doCallbacks()Choreographer.java:590
android.view.Choreographer.doFrame()Choreographer.java:560
android.view.Choreographer$FrameDisplayEventReceiver.run()Choreographer.java:763
android.os.Handler.handleCallback()Handler.java:739
android.os.Handler.dispatchMessage()Handler.java:95
android.os.Looper.loop()Looper.java:145
android.app.ActivityThread.main()ActivityThread.java:5951
java.lang.reflect.Method.invoke(Native Method)
java.lang.reflect.Method.invoke()Method.java:372
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run()ZygoteInit.java:1400
com.android.internal.os.ZygoteInit.main()ZygoteInit.java:1195
Comment 2 Samantha Houts [MSFT] 2016-12-19 19:51:14 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue, we would very much appreciate it.  
 
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d  

Warm regards, 
Xamarin Forms Team
Comment 3 David Ortinau [MSFT] 2017-05-31 17:12:29 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!