0
votes

Every time I create a new Xamarin.Forms Blank XAML Project it throws an Unhandled Exception when running the Android platform:

"Android.Views.InflateException: Binary XML file line #1: Error inflating class android.support.v7.widget.Toolbar"

Notice that to reproduce this issue it's not necessary to add code or views. Just create a project and execute in an Android platform.

I'm deploying in a Samsung tablet with Android 5.1 - API 22

My development environment is:

  • Visual Studio 2015 with Update 3:
    • Xamarin 4.2.2.11
    • Xamarin.Android 7.0.2.42
  • JDK 1.8.0.112
  • Android NDK r13b

Default Xamarin Forms project includes the following NuGet package versions:

  • Xamarin.Forms 2.3.3.180
  • Xamarin.Android.Support.v4 v23.3.0
  • Xamarin.Android.Support.v7.* v23.3.0

I was able to solve this error by downgrading Xamarin.Forms from 2.3.3.180 to 2.3.3.168

I would like to know why this is happening and whether its a bug or wrong versions installed.

Thanks!

1

1 Answers

0
votes

I ran into this issue yesterday. You need to make sure you have a theme set in the Android Manifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" android:theme="@android:style/Theme.Material.Light" package="yourpackage" android:versionCode="0" android:versionName="Alpha">

More info: https://bugzilla.xamarin.com/show_bug.cgi?id=41380