[Forms Android] - Tabbed page on 4.1 causes Resource ID not found crash

I've been going around this issue for a couple of weeks. Basically any app with a Tabbed Page on Xam Forms > 2.1 causes a crash on Android 4.1.x.

If you downgrade to 2.1 then this crash goes away, but it causes issues in Android 6.0. So I'm kinda stumped. I read a few articles and items on bugzilla, with the only result seemingly being to downgrade, which I can't do due to other bugs.

Attached is a sample app that causes this crash on 4.1.x -> it's basically blank app with a 3 tabs. If you hit all the tabs and then go back to the middle tab the crash occurs. It DOES NOT occur on 5.0 and greater, nor on any version of iOS I've tested.

Anyone found a work around for this, that isn't downgrading XF versions?

Stack trace:

Android.Content.Res.Resources+NotFoundException: Unable to find resource ID #0x401

11-16 17:01:50.468 D/Mono    (14552): DllImport attempting to load: '/system/lib/liblog.so'.
11-16 17:01:50.468 D/Mono    (14552): DllImport loaded library '/system/lib/liblog.so'.
11-16 17:01:50.468 D/Mono    (14552): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
11-16 17:01:50.468 D/Mono    (14552): Searching for '__android_log_print'.
11-16 17:01:50.468 D/Mono    (14552): Probing '__android_log_print'.
11-16 17:01:50.468 D/Mono    (14552): Found as '__android_log_print'.
11-16 17:01:50.498 I/MonoDroid(14552): UNHANDLED EXCEPTION:
11-16 17:01:50.518 I/MonoDroid(14552): Android.Content.Res.Resources+NotFoundException: Unable to find resource ID #0x401
11-16 17:01:50.518 I/MonoDroid(14552):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3511/77cb8568/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
11-16 17:01:50.518 I/MonoDroid(14552):   at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x000a7] in /Users/builder/data/lanes/3511/ce955cc0/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:12083 
11-16 17:01:50.518 I/MonoDroid(14552):   at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (System.IntPtr jobject, System.IntPtr jclass, System.IntPtr jmethod, Android.Runtime.JValue* parms) [0x00000] in /Users/builder/data/lanes/3511/ce955cc0/source/monodroid/src/Mono.Android/JNIEnv.g.cs:444 
11-16 17:01:50.518 I/MonoDroid(14552):   at Android.Support.V4.View.ViewPager.SetCurrentItem (System.Int32 item, System.Boolean smoothScroll) [0x000a4] in <27c17fe440cf491ba8255bcefade6e02>:0 
11-16 17:01:50.518 I/MonoDroid(14552):   at Xamarin.Forms.Platform.Android.AppCompat.TabbedPageRenderer.ScrollToCurrentPage () [0x00016] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\TabbedPageRenderer.cs:273 
11-16 17:01:50.518 I/MonoDroid(14552):   at Xamarin.Forms.Platform.Android.AppCompat.TabbedPageRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00027] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\TabbedPageRenderer.cs:194 
11-16 17:01:50.518 I/MonoDroid(14552):   at (wrapper delegate-invoke) <Module>:invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs)
11-16 17:01:50.518 I/MonoDroid(14552):   at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x0000a] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindableObject.cs:137 
11-16 17:01:50.518 I/MonoDroid(14552):   at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Core\Element.cs:379 
11-16 17:01:50.518 I/MonoDroid(14552):   at Xamarin.Forms.MultiPage`1[T].OnPropertyChanged (System.String propertyName) [0x0009d] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Core\MultiPage.cs:151 
11-16 17:01:50.518 I/MonoDroid(14552):   at Xamarin.Forms.MultiPage`1[T].set_CurrentPage (T value) [0x00026] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Core\MultiPage.cs:81 
11-16 17:01:50.518 I/MonoDroid(14552):   at Xamarin.Forms.Platform.Android.AppCompat.TabbedPageRenderer.Android.Support.Design.Widget.TabLayout.IOnTabSelectedListener.OnTabSelected (Android.Support.Design.Widget.TabLayout+Tab tab) [0x00027] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\TabbedPageRenderer.cs:80 
11-16 17:01:50.518 I/MonoDroid(14552):   at Android.Support.Design.Widget.TabLayout+IOnTabSelectedListenerInvoker.n_OnTabSelected_Landroid_support_design_widget_TabLayout_Tab_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_tab) [0x00011] in <12ef52c9fdb344f58cbdf75db3fa86d8>:0 
11-16 17:01:50.518 I/MonoDroid(14552):   at (wrapper dynamic-method) System.Object:31cbfcc9-5e4d-4f82-8ebd-f316af13f0bd (intptr,intptr,intptr)
11-16 17:01:50.518 I/MonoDroid(14552):   --- End of managed Android.Content.Res.Resources+NotFoundException stack trace ---
11-16 17:01:50.518 I/MonoDroid(14552): android.content.res.Resources$NotFoundException: Unable to find resource ID #0x401
11-16 17:01:50.518 I/MonoDroid(14552):  at android.content.res.Resources.getResourceName(Resources.java:1661)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1059)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1234)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2046)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:1989)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1092)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.app.FragmentManagerImpl.attachFragment(FragmentManager.java:1430)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:732)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:570)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.view.ViewPager.populate(ViewPager.java:1177)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:608)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:570)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:562)
11-16 17:01:50.518 I/MonoDroid(14552):  at md5270abb39e60627f0f200893b490a1ade.TabbedPageRenderer.n_onTabSelected(Native Method)
11-16 17:01:50.518 I/MonoDroid(14552):  at md5270abb39e60627f0f200893b490a1ade.TabbedPageRenderer.onTabSelected(TabbedPageRenderer.java:87)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.design.widget.TabLayout.selectTab(TabLayout.java:1025)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.design.widget.TabLayout.selectTab(TabLayout.java:995)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.design.widget.TabLayout$Tab.select(TabLayout.java:1272)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.support.design.widget.TabLayout$TabView.performClick(TabLayout.java:1377)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.view.View$PerformClick.run(View.java:17082)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.os.Handler.handleCallback(Handler.java:615)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.os.Handler.dispatchMessage(Handler.java:92)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.os.Looper.loop(Looper.java:137)
11-16 17:01:50.518 I/MonoDroid(14552):  at android.app.ActivityThread.main(ActivityThread.java:4867)
11-16 17:01:50.518 I/MonoDroid(14552):  at java.lang.reflect.Method.invokeNative(Native Method)
11-16 17:01:50.518 I/MonoDroid(14552):  at java.lang.reflect.Method.invoke(Method.java:511)
11-16 17:01:50.518 I/MonoDroid(14552):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
11-16 17:01:50.518 I/MonoDroid(14552):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
11-16 17:01:50.518 I/MonoDroid(14552):  at dalvik.system.NativeStart.main(Native Method)
11-16 17:01:50.528 D/Mono    (14552): DllImport searching in: '__Internal' ('(null)').
11-16 17:01:50.528 D/Mono    (14552): Searching for 'java_interop_jnienv_throw'.
11-16 17:01:50.528 D/Mono    (14552): Probing 'java_interop_jnienv_throw'.
11-16 17:01:50.538 D/Mono    (14552): Found as 'java_interop_jnienv_throw'.
An unhandled exception occured.

11-16 17:01:51.039 E/mono    (14552): 
11-16 17:01:51.039 E/mono    (14552): Unhandled Exception:
11-16 17:01:51.039 E/mono    (14552): Android.Content.Res.Resources+NotFoundException: Unable to find resource ID #0x401
11-16 17:01:51.039 E/mono    (14552):   --- End of managed Android.Content.Res.Resources+NotFoundException stack trace ---
11-16 17:01:51.039 E/mono    (14552): android.content.res.Resources$NotFoundException: Unable to find resource ID #0x401
11-16 17:01:51.039 E/mono    (14552):   at android.content.res.Resources.getResourceName(Resources.java:1661)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1059)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1234)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2046)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:1989)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1092)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.app.FragmentManagerImpl.attachFragment(FragmentManager.java:1430)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:732)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:570)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.view.ViewPager.populate(ViewPager.java:1177)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:608)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:570)
11-16 17:01:51.039 E/mono    (14552):   at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:562)
11-16 17:01:51.039 E/mono    (14552):   at md5270abb39e60627f0f200893b490a1ade.TabbedPageRenderer.n_onTabSelected(Native Method)
11-16 17:01:51.039 E/mono    (14552):   at md5270abb39e60627f0f200893b490a1ade.TabbedPageRenderer.onTabSelected(TabbedPageRenderer.java:87)
11-16 17:01:51.039 E/mono    (14552):   at android.support.design.widget.TabLayout.selectTab(TabLayout.java:1025)
11-16 17:01:51.039 E/mono    (14552):   at android.support.design.widget.TabLayout.selectTab(TabLayout.java:995)
11-16 17:01:51.039 E/mono    (14552):   at android.support.design.widget.TabLayout$Tab.select(TabLayout.java:1272)
11-16 17:01:51.039 E/mono    (14552):   at android.support.design.widget.TabLayout$TabView.performClick(TabLayout.java:1377)
11-16 17:01:51.039 E/mono    (14552):   at android.view.View$PerformClick.run(View.java:17082)
11-16 17:01:51.039 E/mono    (14552):   at android.os.Handler.handleCallback(Handler.java:615)
11-16 17:01:51.039 E/mono    (14552):   at android.os.Handler.dispatchMessage(Handler.java:92)
11-16 17:01:51.039 E/mono    (14552):   at android.os.Looper.loop(Looper.java:137)
11-16 17:01:51.039 E/mono    (14552):   at android.app.ActivityThread.main(ActivityThread.java:4867)
11-16 17:01:51.039 E/mono    (14552):   at java.lang.reflect.Method.invokeNative(Native Method)
11-16 17:01:51.039 E/mono    (14552):   at java.lang.reflect.Method.invoke(Method.java:511)
11-16 17:01:51.039 E/mono    (14552):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
11-16 17:01:51.039 E/mono    (14552):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
11-16 17:01:51.039 E/mono    (14552):   at dalvik.system.NativeStart.main(Native Method)
11-16 17:01:51.039 E/mono    (14552): 
11-16 17:01:51.039 E/mono-rt (14552): [ERROR] FATAL UNHANDLED EXCEPTION: Android.Content.Res.Resources+NotFoundException: Unable to find resource ID #0x401
11-16 17:01:51.039 E/mono-rt (14552):   --- End of managed Android.Content.Res.Resources+NotFoundException stack trace ---
11-16 17:01:51.039 E/mono-rt (14552): android.content.res.Resources$NotFoundException: Unable to find resource ID #0x401
11-16 17:01:51.039 E/mono-rt (14552):   at android.content.res.Resources.getResourceName(Resources.java:1661)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1059)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1234)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2046)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:1989)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1092)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.app.FragmentManagerImpl.attachFragment(FragmentManager.java:1430)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:732)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:570)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.view.ViewPager.populate(ViewPager.java:1177)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:608)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:570)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:562)
11-16 17:01:51.039 E/mono-rt (14552):   at md5270abb39e60627f0f200893b490a1ade.TabbedPageRenderer.n_onTabSelected(Native Method)
11-16 17:01:51.039 E/mono-rt (14552):   at md5270abb39e60627f0f200893b490a1ade.TabbedPageRenderer.onTabSelected(TabbedPageRenderer.java:87)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.design.widget.TabLayout.selectTab(TabLayout.java:1025)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.design.widget.TabLayout.selectTab(TabLayout.java:995)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.design.widget.TabLayout$Tab.select(TabLayout.java:1272)
11-16 17:01:51.039 E/mono-rt (14552):   at android.support.design.widget.TabLayout$TabView.performClick(TabLayout.java:1377)
11-16 17:01:51.039 E/mono-rt (14552):   at android.view.View$PerformClick.run(View.java:17082)
11-16 17:01:51.039 E/mono-rt (14552):   at android.os.Handler.handleCallback(Handler.java:615)
11-16 17:01:51.039 E/mono-rt (14552):   at android.os.Handler.dispatchMessage(Handler.java:92)
11-16 17:01:51.039 E/mono-rt (14552):   at android.os.Looper.loop(Looper.java:137)
11-16 17:01:51.039 E/mono-rt (14552):   at android.app.ActivityThread.main(ActivityThread.java:4867)
11-16 17:01:51.039 E/mono-rt (14552):   at java.lang.reflect.Method.invokeNative(Native Method)
11-16 17:01:51.039 E/mono-rt (14552):   at java.lang.reflect.Method.invoke(Method.java:511)
11-16 17:01:51.039 E/mono-rt (14552):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
11-16 17:01:51.039 E/mono-rt (14552):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
11-16 17:01:51.039 E/mono-rt (14552):   at dalvik.system.NativeStart.main(Native Method)
Sign In or Register to comment.