locked
[Android] App Crashing while Page Navigation with error as NavigationPageRenderer.UpdateToolbar () RRS feed

  • Question

  • User166490 posted

    When I am trying to move from one page to another page, the app is getting crashed with the below error. This is happening after I upgraded the Xamarin.Forms version to 4.7.0.1080

    NavigationPageRenderer.UpdateToolbar () - System.NullReferenceException: Object reference not set to an instance of an object.

    Xamarin Forms Version: 4.7.0.1080

    Note: * Sometime App not crashing but BackButton Icon & Header Label not showing. * Is there any possibility to resolve this issue by downgrading the Xamarin.Forms version to 4.6 or 4.5.

    AppCenter Stack Trace:

    Android: 9 Android Build: PKQ1.180917.001 Manufacturer: Xiaomi Model: Redmi 6 Pro

    Xamarin Exception Stack: System.NullReferenceException: Object reference not set to an instance of an object at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.UpdateToolbar () [0x0007d] in <5cfeb6476b5641c5b43daf7d3f36a1c8>:0 at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer+<>cDisplayClass970.b0 () [0x0002b] in <5cfeb6476b5641c5b43daf7d3f36a1c8>:0 at Xamarin.Forms.Forms+AndroidPlatformServices+<>cDisplayClass240.b0 () [0x00000] in <5cfeb6476b5641c5b43daf7d3f36a1c8>:0 at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in :0 at Java.Lang.IRunnableInvoker.nRun (System.IntPtr jnienv, System.IntPtr native_this) [0x00009] in :0 at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.28(intptr,intptr)

    Friday, July 24, 2020 2:00 PM

All replies

  • User371688 posted

    Xamarin Exception Stack: System.NullReferenceException: Object reference not set to an instance of an object at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.UpdateToolbar () [0x0007d] in <5cfeb6476b5641c5b43daf7d3f36a1c8>:0 at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer+<>cDisplayClass970.b0 () [0x0002b] in <5cfeb6476b5641c5b43daf7d3f36a1c8>:0 at Xamarin.Forms.Forms+AndroidPlatformServices+<>cDisplayClass240.b0 () [0x00000] in <5cfeb6476b5641c5b43daf7d3f36a1c8>:0 at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in :0 at Java.Lang.IRunnableInvoker.nRun (System.IntPtr jnienv, System.IntPtr native_this) [0x00009] in :0 at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.28(intptr,intptr)

    From above log, some variable's value in your code should be null. You should initialize it before you use it.

    For this question, you can debug step by step to find the cause of it .

    Besides, you said this error is happening after you upgraded the Xamarin.Forms version to 4.7.0.1080, then you can try to downgrade xamarin forms to previous version, and try again.

    If the problem persists, could you please post a basic demo so that we can test on our side?

    Monday, July 27, 2020 7:01 AM
  • User166490 posted

    Hi @jezh ,

    I am tired 4.6.0.726 & 4.6.0.800 Version.

    XF Bug: https://github.com/xamarin/Xamarin.Forms/issues/9509

    Monday, July 27, 2020 8:03 AM
  • User166490 posted

    Hi @jezh ,

    My Demo Video : https://1drv.ms/v/s!ApNbCUzKJkfsoGEC5oA1oaJfSmDx

    Monday, July 27, 2020 8:12 AM
  • User371688 posted

    From your demo video, I couldn't find any crash as you mentioned above.

    What's the version of the xamarin from nuget of your demo? And have you tested on other devices except Redmi 6 Pro?

    Tuesday, July 28, 2020 9:48 AM
  • User166490 posted

    Hi @jezh, Sometimes it is crashing. In this video toolbar Label & Back Button Icon not showed.

    Tuesday, July 28, 2020 1:04 PM
  • User371688 posted

    Since we couldn't reproduce this question , could you please post a basic demo so that we can test on our side?

    Wednesday, July 29, 2020 8:14 AM
  • User166490 posted

    Hi @jezh ,I found the issue & fixed... Thanks for your response :smile:

    Wednesday, July 29, 2020 8:33 AM
  • User371688 posted

    Congrats, and could you please share your answer and mark it so that others will get help from here? Thank you in advance.

    Wednesday, July 29, 2020 8:46 AM