Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

New VisualStudio forms project, crashes on startup on real device. Android.Views.InflateException:

$
0
0

I created a new solution to isolate this. This is my first time building and running on a actual device using Xamarin.

Device, Galaxy Note 3, is configured properly for debugging; I can make a blank android app, build it and run it on my device from visual studio no worries. The issue appears to be with Xamarin.Forms projects.

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

Code, exception location in bold:

using System;

using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace App11.Droid
{
    [Activity(Label = "App11", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
    {
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource = Resource.Layout.Toolbar;

**            base.OnCreate(bundle);**

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App());
        }
    }
}

Tried

  • Downloading an older android SDK to setting the compling using..., minmum Android...., and target android... versions all to android 5.0; the version on my device
  • Clearing out the app data\local\xamarin\zips
  • Playing with nuget packages. I've tried updating all, not updating, etc.
    Forms is 2.3.3.180
    Xamarin.Android.* is 24.2.1

I did some googling, in general it appears to be caused by using controls that don't exist after an update, or by dodgy XAML. But I'm using the boilerplate provided by the project type. The app does run correctly in the emulators.

Not sure what else to try.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>