Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 for Bug 41380 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
I have a Xamarin.Forms 184.108.40.206-pre2 project.
After I upgraded Xamarin.Android.Support.v7.AppCompat 220.127.116.11 to 23.3.0 this has started throwing Android.Views.InflateException: Binary XML file line #1: Error inflating class android.support.v7.widget.toolbar exception.
FormsAppCompatActivity.ToolbarResource = Resource.Layout.toolbar;
<?xml version="1.0" encoding="utf-8"?>
Could you possibly put together a reproduction sample? It would be much appreciated. For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d
Hi Paul, I tried to reproduce the problem in a new project without success, it works. But still present in my project. I tried to remo e the support libraries and re-install without success. I also found this old link.
I upgraded to 18.104.22.168 pre3 (I need beta channel for some features) and the problem still persists...
I also tried to force remove Xamarin.Androdi.Support.v7.AppCompact nuget package and re-add it without success..
This error seems to potentially have a number of causes, but at least one that i haven't seen reported elsewhere is a missing
from the application tag in android manifest (replace MyTheme with whatever your theme name is). A couple interesting things here:
1) Under normal circumstances a missing theme gives you an error saying "you need to use a theme.appcompat theme" which is pretty descriptive
2) If you are using FormsAppCompatActivity.ToolbarResource _and_ if that file is using "?attr/actionBarSize" (or possibly any "?attr/") then you will instead get the "inflating Toolbar..." error
Going to try to reproduce this on a non-forms Android project and will add another comment with results
I can _not_ recreate under any reasonably normal circumstances in a xamarin.android (non-forms) project.
Correction: This can be reproduced on xamarin.android.
Steps to reproduce:
1) Be using AppCompatActivity
2) Omit a theme declaration from your androidManifest
(Normally this produced a nice respectable error)
3) Add an toolbar.axml that uses
4) Add toolbar to activity through code (NOT THROUGH AXML!) like so:
var toolbar = LayoutInflater.Inflate(Resource.Layout.toolbar, null, false);
This is the technique XF uses and this causes the exception. If you do not use any "?attr" values _OR_ if you load your toolbar through AXML includes you get a nice respectable error message about adding a theme.
In all of these conditions, adding a compat theme to the Manifest fixes all exceptions.
Hi Andrea please provide your themes file and your main activity code.
This seems a problem where is something missing in your project that we can't identify without more info.
Xamarin Forms Team
This doesn't seem like a bug as you must set the Theme in the Android Manifest as documented:
Easy to miss though.
Were you able to resolve this issue with the suggestions made in the ticket?
In my case, it was a problem with my android styles not being loaded correctly
I was missing the theme in the AndroidManifest. Adding it fixed the error for me.
But you have to be lucky to find this bug report. The error message doesn't help at all.
This appears to be answered. Please reopen this report if adding the theme in the Android Manifest as documented in https://developer.xamarin.com/guides/xamarin-forms/platform-features/android/appcompat/#4._Update_AndroidManifest.xml does not resolve the issue.
same problem with a new crossplatform Portable project with API 20, 21, 22
With last version of xamarin.Forms.
Works normaly on API 19 or API 23.
I've follow the link recommended without sucess.
Nicolas, could you please attach the project which you are using to reproduce this error? Did you have to upgrade from a previous project or did you start with the template project? If you had to upgrade, could you please provide the project before the upgrade?
Thanks for taking the time to report this issue!
Just make a new project in cross-Platform Blank App (Xamarin.form.portable) without touching anything (in the project attached i removed all the non Droid sub-project, but in my main project there are used).
I've all the latest upgrade from xamarin for visual studio + Xamarin dll.
Thx for the help
Attchment : http://www.sendbox.fr/4382d4f6d6bff6a1/Test-App2.rar
I have this issue when I create a new project in VS2015 from the "Blank Xaml App (Xamarin.Forms Portable).
After creating a new project from the Blank Xaml App, I applied changes from the page you included and the results are the same exception.
I am seeing the same result after following the same steps as Adam. I'm using a Moto E running Android 5.1, and indicated this in properties dialog for both the Compile using and Min Android to target and Target Android version. I can deploy the app to the Andriod_Accelerated_X86 vm running Android 6 and SDK level 23. Just ran the update on the Moto E as well so the OS on the device s/b up to date. Any help would be appreciated.
I also created a new project in VS2015 from the "Blank Xaml App (Xamarin.Forms Portable).
The error was thrown even with the theme added to the manifest.
The created app used xamarin.forms version 22.214.171.124.
After changing this to xamarin.forms version 126.96.36.199, the error was gone.
Kind regards, Saskia
I GOT THE SAME ERROR, BUT TRYING ALL DIFFERENT THINGS SUGGESTED IN DIFFERENT THREADS IN DIFFERENT LOCATIONS I TRIED BELOW.
THIS WORKED FOR ME.
DELETED "Xamarin.Android.Support.v7.AppCompat" FOLDER FROM LOCATION
THIS IS FOR WINDOWS NOT SURE ABOUT IF YOU ARE DEVELOPING IN MAC MACHINE
Created attachment 19484 [details]
I also faced this error when I ran the Android demo of the following library ( master's HEAD (8567b5e)).
It always happened when I ran it on API 21 physical device (LG-D821).
But it didn't happened on API 25 simulator (Nexus 6P).
Can you guys reproduce it?
Comments 19 worked for me.
You may have a mismatch with the packages installed. For example, the scenario in Comment 21 can be resolved by reinstalling the Xamarin.Android.Support packages on both the Demo.Droid project and the CarouselView.FormsPlugin.Android project; this will install the packages targeting monoandroid70.
Reassigning to the XA build tooling because
a) the need to do a clean build implies that something is broken in incremental builds
b) there should be a build-time error message for this problem