Bug 37779 - TabbedPageRenderer throws exceptions on Android 4.0.4 when using Material Design theme
Summary: TabbedPageRenderer throws exceptions on Android 4.0.4 when using Material Des...
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.0.0
Hardware: Macintosh All
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-01-18 19:28 UTC by Roger Peters
Modified: 2016-02-04 17:39 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Sample Android Xamarin Forms project exhibiting crash on API level 15 on startup (61.52 KB, application/zip)
2016-01-18 19:28 UTC, Roger Peters

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:

Description Roger Peters 2016-01-18 19:28:45 UTC
Created attachment 14619 [details]
Sample Android Xamarin Forms project exhibiting crash on API level 15 on startup

Creating a simple Xamarin Forms project using a TabbedPage and then updating it with Material Design stylings (ref: https://blog.xamarin.com/material-design-for-your-xamarin-forms-android-apps/) causes a startup crash on a Galaxy Note 1 running Android 4.0.4. The issue does not occur targeting API level 16 or API level 22, but does for Galaxy Note 1 running API level 15 - repro project attached.

Exception details:

Java.Lang.NoSuchMethodError: no method with name='getMinimumHeight' signature='()I' in class Landroid/view/View;
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/2098/3efa14c4/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at Android.Runtime.JNIEnv.GetMethodID (IntPtr kls, System.String name, System.String signature) [0x00066] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:162
  at Android.Views.View.get_MinimumHeight () [0x00014] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.View.cs:7967
  at Xamarin.Forms.Platform.Android.AppCompat.TabbedPageRenderer.OnLayout (Boolean changed, Int32 l, Int32 t, Int32 r, Int32 b) [0x00045] in <filename unknown>:0
  at Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII (IntPtr jnienv, IntPtr native__this, Boolean p0, Int32 p1, Int32 p2, Int32 p3, Int32 p4) [0x00008] in <filename unknown>:0
  at at (wrapper dynamic-method) System.Object:53dc8fba-a4dc-4936-9fac-9f3c76d61832 (intptr,intptr,bool,int,int,int,int)
  at --- End of managed exception stack trace ---
  at java.lang.NoSuchMethodError: no method with name='getMinimumHeight' signature='()I' in class Landroid/view/View;
  at at md5270abb39e60627f0f200893b490a1ade.TabbedPageRenderer.n_onLayout(Native Method)
  at at md5270abb39e60627f0f200893b490a1ade.TabbedPageRenderer.onLayout(TabbedPageRenderer.java:70)
  at at android.view.View.layout(View.java:11278)
  at at android.view.ViewGroup.layout(ViewGroup.java:4224)
  at at com.xamarin.forms.platform.android.FormsViewGroup.measureAndLayout(FormsViewGroup.java:29)
  at at md5cbe6b1e61c9092f258cf21b9d78cec28.MainActivity.n_onCreate(Native Method)
  at at md5cbe6b1e61c9092f258cf21b9d78cec28.MainActivity.onCreate(MainActivity.java:28)
  at at android.app.Activity.performCreate(Activity.java:4465)
  at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2033)
  at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
  at at android.app.ActivityThread.access$600(ActivityThread.java:132)
  at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1157)
  at at android.os.Handler.dispatchMessage(Handler.java:99)
  at at android.os.Looper.loop(Looper.java:137)
  at at android.app.ActivityThread.main(ActivityThread.java:4575)
  at at java.lang.reflect.Method.invokeNative(Native Method)
  at at java.lang.reflect.Method.invoke(Method.java:511)
  at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
  at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
  at at dalvik.system.NativeStart.main(Native Method)
Comment 1 Roger Peters 2016-01-18 19:33:50 UTC
To clarify, I should not have used the word 'targetting' - I meant selecting different devices to run against. The project properties are set to their defaults, which is having API level 15 as the minimum Android version, and API level 23 as the target Android version. All I am doing is changing what it is deploying to - and it crashes when deploying to a level 15 device.
Comment 2 James Montemagno [MSFT] 2016-01-18 22:11:47 UTC
Confirmed here, current work around is to target API 16+ when using material tabs.
Comment 3 Rui Marinho 2016-01-20 11:41:57 UTC
Should be fixed in 2.1.0-pre1
Comment 4 Parmendra Kumar 2016-02-04 17:39:22 UTC
I have checked this issue with Xamarin.Forms and its working fine.

Hence closing this issue.