I have a XF (Android) Application. On AppCenter I have this error:
java.lang.NullPointerException: Attempt to read from field 'int android.view.View.mPrivateFlags' on a null object reference
at android.view.ViewGroup.resetCancelNextUpFlag(ViewGroup.java:2414)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2319)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:414)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1808)
at android.app.Dialog.dispatchTouchEvent(Dialog.java:806)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:376)
at android.view.View.dispatchPointerEvent(View.java:10244)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4485)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4353)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3900)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3953)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3919)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4046)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3927)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4103)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3900)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3953)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3919)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3927)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3900)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6306)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6280)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6241)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6409)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java:-2)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Method.java:-2)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Thread 290:
0 java.lang.Object.wait(Object.java:-2)
1 java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:150)
2 java.lang.Thread.run(Thread.java:761)
Thread 291:
0 java.lang.Object.wait(Object.java:-2)
1 java.lang.Object.wait(Object.java:407)
2 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:188)
3 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:209)
4 java.lang.Daemons$FinalizerDaemon.run(Daemons.java:204)
5 java.lang.Thread.run(Thread.java:761)
Thread 292:
0 java.lang.Object.wait(Object.java:-2)
1 java.lang.Daemons$FinalizerWatchdogDaemon.sleepUntilNeeded(Daemons.java:269)
2 java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:249)
3 java.lang.Thread.run(Thread.java:761)
Thread 293:
0 dalvik.system.VMRuntime.runHeapTasks(VMRuntime.java:-2)
1 java.lang.Daemons$HeapTaskDaemon.run(Daemons.java:433)
2 java.lang.Thread.run(Thread.java:761)
Thread 302:
0 android.os.MessageQueue.nativePollOnce(MessageQueue.java:-2)
1 android.os.MessageQueue.next(MessageQueue.java:323)
2 android.os.Looper.loop(Looper.java:136)
3 android.os.HandlerThread.run(HandlerThread.java:61)
Thread 305:
0 java.lang.Object.wait(Object.java:-2)
1 java.lang.Thread.parkFor$(Thread.java:2127)
2 sun.misc.Unsafe.park(Unsafe.java:325)
3 java.util.concurrent.locks.LockSupport.park(LockSupport.java:161)
4 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2035)
5 java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
6 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1058)
7 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
8 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
9 java.lang.Thread.run(Thread.java:761)
Thread 307:
0 android.os.MessageQueue.nativePollOnce(MessageQueue.java:-2)
1 android.os.MessageQueue.next(MessageQueue.java:323)
2 android.os.Looper.loop(Looper.java:136)
3 android.os.HandlerThread.run(HandlerThread.java:61)
Thread 315:
0 android.net.LocalSocketImpl.readba_native(LocalSocketImpl.java:-2)
1 android.net.LocalSocketImpl.-wrap1(LocalSocketImpl.java:-1)
2 android.net.LocalSocketImpl$SocketInputStream.read(LocalSocketImpl.java:110)
3 com.qti.tcmclient.DpmTcmClient$TcmReceiver.run(DpmTcmClient.java:140)
4 java.lang.Thread.run(Thread.java:761)
Thread 316:
0 java.lang.Object.wait(Object.java:-2)
1 com.android.okhttp.okio.AsyncTimeout.awaitTimeout(AsyncTimeout.java:311)
2 com.android.okhttp.okio.AsyncTimeout.-wrap0(AsyncTimeout.java:-1)
3 com.android.okhttp.okio.AsyncTimeout$Watchdog.run(AsyncTimeout.java:286)
None
No error
Error
@acaliaro Can you please attach a small project that demonstrates this issue? If not, can you at least describe what controls your app uses and what interactions you think may have led to this? Thanks!
Sorry @samhouts , the problem is very big and I use a lot of controls. I have no idea where could be the problem. It's a project I have inherited from other developers.
Can you tell me some possible reasons that can cause this problem?
@acaliaro I'm afraid there's not much in that stack trace that helps us track it down. It looks like a touch event is happening on something that is being disposed before the gesture finishes. Possibly a ListView with context actions that is being scrolled and long pressed at the same time. Possibly a page that is popped from the navigation stack on a button press. There are many possibilities.
If you're able to narrow this down, please let us know. Thanks!
@samhouts I had a similar issue. After I updated Xamarin.Forms, when I clicked an item from the Hamburger Menu, I was getting this error "Attempt to read from field 'int android.view.ViewGroup$LayoutParams.width' on a null object reference". I solved it downgrading the version. Maybe the details below help.
Stack Trace
at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0001f] in
at Android.Widget.TextView.set_HintFormatted (Java.Lang.ICharSequence value) [0x00029] in <8c07a09624c14764b43f6b946a5a1f23>:0
at Android.Widget.TextView.set_Hint (System.String value) [0x0000d] in <8c07a09624c14764b43f6b946a5a1f23>:0
at Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer.Xamarin.Forms.Platform.Android.IVisualElementRenderer.GetDesiredSize (System.Int32 widthConstraint, System.Int32 heightConstraint) [0x0015a] in D:\a1\s\Xamarin.Forms.Platform.Android\FastRenderers\LabelRenderer.cs:127
at Xamarin.Forms.Platform.Android.Platform.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) [0x000ae] in D:\a1\s\Xamarin.Forms.Platform.Android\Platform.cs:1332
at Xamarin.Forms.Forms+AndroidPlatformServices.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a1\s\Xamarin.Forms.Platform.Android\Forms.cs:776
at Xamarin.Forms.VisualElement.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00025] in D:\a1\s\Xamarin.Forms.Core\VisualElement.cs:779
at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a1\s\Xamarin.Forms.Core\VisualElement.cs:762
at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a1\s\Xamarin.Forms.Core\VisualElement.cs:644
at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a1\s\Xamarin.Forms.Core\VisualElement.cs:702
at Syncfusion.SfGauge.XForms.Droid.SfGaugeRenderer.GetNativeView (Xamarin.Forms.View formGauge, Xamarin.Forms.View view, Android.Views.ViewGroup+LayoutParams layoutParams, Android.Content.Context context) [0x0003e] in
at Syncfusion.SfGauge.XForms.Droid.AnnotationMapping.OnAnnotationPropertiesChanged (System.String propertyName, Syncfusion.SfGauge.XForms.GaugeAnnotation formAnnotation, Com.Syncfusion.Gauges.SfCircularGauge.GaugeAnnotation nativeAnnotation) [0x0007b] in
at Syncfusion.SfGauge.XForms.Droid.AnnotationMapping.GetAnnotation (Syncfusion.SfGauge.XForms.GaugeAnnotation formAnnotation) [0x00029] in
at Syncfusion.SfGauge.XForms.Droid.SfCircularGaugeMapping.OnGaugePropertiesChanged (System.String propertyName, Syncfusion.SfGauge.XForms.SfCircularGauge formsGauge, Com.Syncfusion.Gauges.SfCircularGauge.SfCircularGauge nativeGauge) [0x00195] in
at Syncfusion.SfGauge.XForms.Droid.SfGaugeRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs1[TElement] e) [0x00072] in <a8f6f09a7a484f41b32e01143971b5d2>:0
at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetElement (TElement element) [0x000b8] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:231
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138
at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334
at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110
at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000d5] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234
at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138
at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334
at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440
at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetElement (TElement element) [0x000d5] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138
at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334
at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110
at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000d5] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234
at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
at Xamarin.Forms.Platform.Android.ScrollViewContainer.set_ChildView (Xamarin.Forms.View value) [0x0002f] in D:\a1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewContainer.cs:37
at Xamarin.Forms.Platform.Android.ScrollViewRenderer.LoadContent () [0x00000] in D:\a1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:364
at Xamarin.Forms.Platform.Android.ScrollViewRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x000cf] in D:\a1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:97
at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138
at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334
at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440
at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetElement (TElement element) [0x000d5] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234
at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Support.V4.App.FragmentManager fragmentManager, Android.Content.Context context) [0x00031] in D:\a1\s\Xamarin.Forms.Platform.Android\Platform.cs:391
at Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState) [0x00008] in D:\a1\s\Xamarin.Forms.Platform.Android\AppCompat\FragmentContainer.cs:56
at Android.Support.V4.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_inflater, System.IntPtr native_container, System.IntPtr native_savedInstanceState) [0x00020] in
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.88(intptr,intptr,intptr,intptr,intptr)
--- End of managed Java.Lang.NullPointerException stack trace ---
java.lang.NullPointerException: Attempt to read from field 'int android.view.ViewGroup$LayoutParams.width' on a null object reference
at android.widget.TextView.checkForRelayout(TextView.java:8862)
at android.widget.TextView.setHintInternal(TextView.java:5884)
at android.widget.TextView.setHint(TextView.java:5873)
at md58432a647068b097f9637064b8985a5e0.FragmentContainer.n_onCreateView(Native Method)
at md58432a647068b097f9637064b8985a5e0.FragmentContainer.onCreateView(FragmentContainer.java:33)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2439)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:802)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3273)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:2466)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1483)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:802)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:814)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Basic Information
Version with issue: 4.4.0.991265
Last known good version: 4.3.0.991211
IDE: Visual Studio For Mac 8.3.10(build 2)
Android: 9.0
Affected Devices: Samsung SM-T590, Nexus 10 Pie
Same issue. In my case I'm using a tabbed page (Android). Switching between a few tabs causes the error. It's good on XF version 4.3.0.991211. Started with version 4.3.0.991221
Java.Lang.NullPointerException: Attempt to read from field 'int android.view.ViewGroup$LayoutParams.width' on a null object reference
at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0001f] in
at Android.Widget.TextView.set_HintFormatted (Java.Lang.ICharSequence value) [0x00029] in <8c07a09624c14764b43f6b946a5a1f23>:0
at Android.Widget.TextView.set_Hint (System.String value) [0x0000d] in <8c07a09624c14764b43f6b946a5a1f23>:0
at Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer.Xamarin.Forms.Platform.Android.IVisualElementRenderer.GetDesiredSize (System.Int32 widthConstraint, System.Int32 heightConstraint) [0x0015a] in D:\a1\s\Xamarin.Forms.Platform.Android\FastRenderers\LabelRenderer.cs:127
at Xamarin.Forms.Platform.Android.Platform.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) [0x000ae] in D:\a1\s\Xamarin.Forms.Platform.Android\Platform.cs:1332
at Xamarin.Forms.Forms+AndroidPlatformServices.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a1\s\Xamarin.Forms.Platform.Android\Forms.cs:776
at Xamarin.Forms.VisualElement.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00025] in D:\a1\s\Xamarin.Forms.Core\VisualElement.cs:779
at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a1\s\Xamarin.Forms.Core\VisualElement.cs:762
at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a1\s\Xamarin.Forms.Core\VisualElement.cs:644
at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a1\s\Xamarin.Forms.Core\VisualElement.cs:702
at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion (Xamarin.Forms.VisualElement child, Xamarin.Forms.Rectangle region) [0x0007b] in D:\a1\s\Xamarin.Forms.Core\Layout.cs:154
at Xamarin.Forms.Page.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x0010d] in D:\a1\s\Xamarin.Forms.Core\Page.cs:266
at Xamarin.Forms.Page.UpdateChildrenLayout () [0x000c9] in D:\a1\s\Xamarin.Forms.Core\Page.cs:342
at Xamarin.Forms.Page.OnSizeAllocated (System.Double width, System.Double height) [0x0000f] in D:\a1\s\Xamarin.Forms.Core\Page.cs:322
at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\a1\s\Xamarin.Forms.Core\VisualElement.cs:784
at Xamarin.Forms.Page.OnChildMeasureInvalidated (Xamarin.Forms.VisualElement child, Xamarin.Forms.Internals.InvalidationTrigger trigger) [0x000a9] in D:\a1\s\Xamarin.Forms.Core\Page.cs:381
at Xamarin.Forms.Page.OnChildMeasureInvalidated (System.Object sender, System.EventArgs e) [0x00013] in D:\a1\s\Xamarin.Forms.Core\Page.cs:304
at Xamarin.Forms.VisualElement.InvalidateMeasureInternal (Xamarin.Forms.Internals.InvalidationTrigger trigger) [0x0000b] in D:\a1\s\Xamarin.Forms.Core\VisualElement.cs:816
at Xamarin.Forms.VisualElement.set_IsPlatformEnabled (System.Boolean value) [0x0001c] in D:\a1\s\Xamarin.Forms.Core\VisualElement.cs:539
at Xamarin.Forms.Platform.Android.Platform+<>c.<.cctor>b__124_0 (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x0000a] in D:\a1\s\Xamarin.Forms.Platform.Android\Platform.cs:40
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a1\s\Xamarin.Forms.Core\BindableObject.cs:463
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a1\s\Xamarin.Forms.Core\BindableObject.cs:397
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x00042] in D:\a1\s\Xamarin.Forms.Core\BindableObject.cs:334
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a1\s\Xamarin.Forms.Core\BindableObject.cs:311
at Xamarin.Forms.Platform.Android.Platform.SetRenderer (Xamarin.Forms.VisualElement bindable, Xamarin.Forms.Platform.Android.IVisualElementRenderer value) [0x00000] in D:\a1\s\Xamarin.Forms.Platform.Android\Platform.cs:363
at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x00111] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:149
at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334
at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440
at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetElement (TElement element) [0x000d5] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234
at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Support.V4.App.FragmentManager fragmentManager, Android.Content.Context context) [0x00031] in D:\a1\s\Xamarin.Forms.Platform.Android\Platform.cs:391
at Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState) [0x00008] in D:\a1\s\Xamarin.Forms.Platform.Android\AppCompat\FragmentContainer.cs:56
at Android.Support.V4.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_inflater, System.IntPtr native_container, System.IntPtr native_savedInstanceState) [0x00020] in
at at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.120(intptr,intptr,intptr,intptr,intptr)
at java.lang.NullPointerException: Attempt to read from field 'int android.view.ViewGroup$LayoutParams.width' on a null object reference
at at android.widget.TextView.checkForRelayout(TextView.java:8485)
at at android.widget.TextView.setHint(TextView.java:5539)
at at md58432a647068b097f9637064b8985a5e0.FragmentContainer.n_onCreateView(Native Method)
at at md58432a647068b097f9637064b8985a5e0.FragmentContainer.onCreateView(FragmentContainer.java:33)
at at android.support.v4.app.Fragment.performCreateView(Fragment.java:2439)
at at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460)
at at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:802)
at at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
at at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
at at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
at at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
at at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3273)
at at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
at at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:2466)
at at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1483)
at at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)
at at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
at at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
at at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
at at android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:2243)
at at android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:654)
at at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:146)
at at android.support.v4.view.ViewPager.populate(ViewPager.java:1244)
at at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:669)
at at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:631)
at at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:623)
at at md58432a647068b097f9637064b8985a5e0.TabbedPageRenderer.n_onTabSelected(Native Method)
at at md58432a647068b097f9637064b8985a5e0.TabbedPageRenderer.onTabSelected(TabbedPageRenderer.java:89)
at at android.support.design.widget.TabLayout.dispatchTabSelected(TabLayout.java:1608)
at at android.support.design.widget.TabLayout.selectTab(TabLayout.java:1601)
at at android.support.design.widget.TabLayout.selectTab(TabLayout.java:1569)
at at android.support.design.widget.TabLayout$Tab.select(TabLayout.java:1874)
at at android.support.design.widget.TabLayout$TabView.performClick(TabLayout.java:2059)
at at android.view.View$PerformClick.run(View.java:24770)
at at android.os.Handler.handleCallback(Handler.java:790)
at at android.os.Handler.dispatchMessage(Handler.java:99)
at at android.os.Looper.loop(Looper.java:164)
at at android.app.ActivityThread.main(ActivityThread.java:6494)
at at java.lang.reflect.Method.invoke(Native Method)
at at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Why is this closed? I have the same issue.
I'm not sure why it's closed. There's plenty of info there about it, including what version of XF it started happening in. I will create another issue with a sample project for them.
Happens to me too with latest XF 4.4 after adding a second page in a TabbedPage.
If TabbedPage only has 1 child then no problem.
Basic Information
Version with issue: 4.4.0.991265
Last known good version: 4.3.0.991211
IDE: Microsoft Visual Studio 2019 Version 16.4.1
Android: 9.0
Most helpful comment
Why is this closed? I have the same issue.