Bug 38597 - java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.internal.widget.ScrollingTabContainerView$TabView.update()' on a null object reference
Summary: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.an...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.0.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-02-09 20:20 UTC by Jon Douglas [MSFT]
Modified: 2016-12-21 15:35 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 FIXED

Description Jon Douglas [MSFT] 2016-02-09 20:20:19 UTC
*Description:

When attempting to update a ContentPage's Title that is a Child of a TabbedPage, the following exception occurs

02-09 15:12:55.085 I/MonoDroid(15208): UNHANDLED EXCEPTION:
02-09 15:12:55.086 I/MonoDroid(15208): Java.Lang.NullPointerException: Attempt to invoke virtual method 'void com.android.internal.widget.ScrollingTabContainerView$TabView.update()' on a null object reference
02-09 15:12:55.086 I/MonoDroid(15208):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/2692/e98e9627/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
02-09 15:12:55.086 I/MonoDroid(15208):   at Android.Runtime.JNIEnv.CallObjectMethod (IntPtr jobject, IntPtr jmethod, Android.Runtime.JValue* parms) [0x00064] in /Users/builder/data/lanes/2692/e98e9627/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:195 
02-09 15:12:55.086 I/MonoDroid(15208):   at Android.App.ActionBar+TabInvoker.SetText (ICharSequence text) [0x0004b] in /Users/builder/data/lanes/2692/e98e9627/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.App.ActionBar.cs:1204 
02-09 15:12:55.086 I/MonoDroid(15208):   at Android.App.ActionBar+Tab.SetText (System.String text) [0x00013] in /Users/builder/data/lanes/2692/e98e9627/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.App.ActionBar.cs:938 
02-09 15:12:55.086 I/MonoDroid(15208):   at Xamarin.Forms.Platform.Android.Platform+<>c__DisplayClass74_0.<AddTab>b__1 (System.Object sender, System.ComponentModel.PropertyChangedEventArgs args) [0x00028] in <filename unknown>:0 
02-09 15:12:55.086 I/MonoDroid(15208):   at (wrapper delegate-invoke) <Module>:invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs)
02-09 15:12:55.086 I/MonoDroid(15208):   at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00012] in <filename unknown>:0 
02-09 15:12:55.087 I/MonoDroid(15208):   at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x000fb] in <filename unknown>:0 
02-09 15:12:55.087 I/MonoDroid(15208):   at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x0014b] in <filename unknown>:0 
02-09 15:12:55.087 I/MonoDroid(15208):   at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, Boolean fromTarget) [0x0020b] in <filename unknown>:0 
02-09 15:12:55.087 I/MonoDroid(15208):   at Xamarin.Forms.BindingExpression.Apply (Boolean fromTarget) [0x0003e] in <filename unknown>:0 
02-09 15:12:55.087 I/MonoDroid(15208):   at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__38_0 () [0x00000] in <filename unknown>:0 
02-09 15:12:55.087 I/MonoDroid(15208):   at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/2692/e98e9627/source/monodroid/src/Mono.Android/src/Java.Lang/Thread.cs:36 
02-09 15:12:55.087 I/MonoDroid(15208):   at Java.Lang.IRunnableInvoker.n_Run (IntPtr jnienv, IntPtr native__this) [0x00009] in /Users/builder/data/lanes/2692/e98e9627/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Java.Lang.IRunnable.cs:71 
02-09 15:12:55.087 I/MonoDroid(15208):   at (wrapper dynamic-method) System.Object:595098fa-2e6a-44a3-bde1-1011c566718a (intptr,intptr)
02-09 15:12:55.087 I/MonoDroid(15208):   --- End of managed exception stack trace ---

02-09 15:12:55.087 I/MonoDroid(15208): java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.internal.widget.ScrollingTabContainerView$TabView.update()' on a null object reference
02-09 15:12:55.087 I/MonoDroid(15208): 	at com.android.internal.widget.ScrollingTabContainerView.updateTab(ScrollingTabContainerView.java:328)
02-09 15:12:55.087 I/MonoDroid(15208): 	at com.android.internal.app.WindowDecorActionBar$TabImpl.setText(WindowDecorActionBar.java:1217)
02-09 15:12:55.087 I/MonoDroid(15208): 	at mono.java.lang.RunnableImplementor.n_run(Native Method)
02-09 15:12:55.087 I/MonoDroid(15208): 	at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
02-09 15:12:55.087 I/MonoDroid(15208): 	at android.app.Activity.runOnUiThread(Activity.java:5524)
02-09 15:12:55.087 I/MonoDroid(15208): 	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.ButtonRenderer_ButtonClickListener.n_onClick(Native Method)
02-09 15:12:55.087 I/MonoDroid(15208): 	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.ButtonRenderer_ButtonClickListener.onClick(ButtonRenderer_ButtonClickListener.java:29)
02-09 15:12:55.087 I/MonoDroid(15208): 	at android.view.View.performClick(View.java:5204)
02-09 15:12:55.087 I/MonoDroid(15208): 	at android.view.View$PerformClick.run(View.java:21153)
02-09 15:12:55.087 I/MonoDroid(15208): 	at android.os.Handler.handleCallback(Handler.java:739)
02-09 15:12:55.087 I/MonoDroid(15208): 	at android.os.Handler.dispatchMessage(Handler.java:95)
02-09 15:12:55.087 I/MonoDroid(15208): 	at android.os.Looper.loop(Looper.java:148)
02-09 15:12:55.087 I/MonoDroid(15208): 	at android.app.ActivityThread.main(ActivityThread.java:5417)
02-09 15:12:55.087 I/MonoDroid(15208): 	at java.lang.reflect.Method.invoke(Native Method)
02-09 15:12:55.087 I/MonoDroid(15208): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
02-09 15:12:55.087 I/MonoDroid(15208): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

It seems that there's a null object reference that we're trying to update() and thus the exception is thrown.

*Reproduction:

Attached(If upload fails, there will be a follow-up comment with a dropbox link)

1. Launch application

2. Tap on the Navigate button

3. Tap on the Update Tab Title button

4. Exception raised

Note: MVVMLight is used as the ViewModelBase for the ViewModel in this sample

*Version Information:

Xamarin Forms 2.0.1.6505
Comment 2 Jani Lirkki 2016-08-25 09:54:33 UTC
This looks like a duplicate of bug https://bugzilla.xamarin.com/show_bug.cgi?id=27350 and is most likely fixed in Xamarin Forms version 2.2.0.4-pre1 (or newer).