locked
Android Support V7 error after updating RRS feed

  • Question

  • User62557 posted

    I got this error after updating to 5.8.1, Version: 4.20.1.0 (Indie Edition), on Mac

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

    All required library are included. I don't have any issue with this app before the update.

    Does anyone having this issue and have a workaround to it?

    Saturday, March 28, 2015 5:55 PM

All replies

  • User209 posted

    Entire stack trace please.

    Saturday, March 28, 2015 7:23 PM
  • User62557 posted

    Sorry Is below the correct one?

    [MonoDroid] UNHANDLED EXCEPTION: [MonoDroid] Android.Views.InflateException: Exception of type 'Android.Views.InflateException' was thrown. [MonoDroid] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <IL 0x00011, 0x00068> [MonoDroid] at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr,Android.Runtime.JValue[]) [0x00084] in /Users/builder/data/lanes/1353/ac29b2c6/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:896 [MonoDroid] at Android.App.Activity.SetContentView (int) [0x00070] in /Users/builder/data/lanes/1353/ac29b2c6/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.App.Activity.cs:4763 [MonoDroid] at Dailyvanity.Droid.MainActivity.OnCreate (Android.OS.Bundle) [0x00044] in /Users/chrissim/Xamarin Projects/Dailyvanity Mobile/Droid/MainActivity.cs:52 [MonoDroid] at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/1353/ac29b2c6/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.App.Activity.cs:2380 [MonoDroid] at (wrapper dynamic-method) object.eb5c055b-51dd-4514-85e8-0bac726daecd (intptr,intptr,intptr) <IL 0x00017, 0x00043> [MonoDroid] --- End of managed exception stack trace --- [MonoDroid] android.view.InflateException: Binary XML file line #1: Error inflating class android.support.v7.widget.Toolbar [MonoDroid] at android.view.LayoutInflater.createView(LayoutInflater.java:623) [MonoDroid] at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:699) [MonoDroid] at android.view.LayoutInflater.parseInclude(LayoutInflater.java:819) [MonoDroid] at android.view.LayoutInflater.rInflate(LayoutInflater.java:748) [MonoDroid] at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) [MonoDroid] at android.view.LayoutInflater.inflate(LayoutInflater.java:495) [MonoDroid] at android.view.LayoutInflater.inflate(LayoutInflater.java:400) [MonoDroid] at android.view.LayoutInflater.inflate(LayoutInflater.java:353) [MonoDroid] at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228) [MonoDroid] at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102) [MonoDroid] at dailyvanity.droid.MainActivity.n_onCreate(Native Method) [MonoDroid] at dailyvanity.droid.MainActivity.onCreate(MainActivity.java:37) [MonoDroid] at android.app.Activity.performCreate(Activity.java:5239) [MonoDroid] at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) [MonoDroid] at com.lbe.security.service.core.client.b.x.callActivityOnCreate(Unknown Source) [MonoDroid] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162) [MonoDroid] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2248) [MonoDroid] at android.app.ActivityThread.access$800(ActivityThread.java:138) [MonoDroid] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199) [MonoDroid] at android.os.Handler.dispatchMessage(Handler.java:102) [MonoDroid] at android.os.Looper.loop(Looper.java:136) [MonoDroid] at android.app.ActivityThread.main(ActivityThread.java:5050) [MonoDroid] at java.lang.reflect.Method.invokeNative(Native Method) [MonoDroid] at java.lang.reflect.Method.invoke(Method.java:515) [MonoDroid] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:805) [MonoDroid] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:621) [MonoDroid] at dalvik.system.NativeStart.main(Native Method) [MonoDroid] Caused by: java.lang.reflect.InvocationTargetException [MonoDroid] at java.lang.reflect.Constructor.constructNative(Native Method) [MonoDroid] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [MonoDroid] at android.view.LayoutInflater.createView(LayoutInflater.java:597) [MonoDroid] ... 26 more [MonoDroid] Caused by: java.lang.NoSuchMethodError: android.support.v4.content.ContextCompat.getDrawable [MonoDroid] at android.support.v7.internal.widget.TintManager.getDrawable(TintManager.java:133) [MonoDroid] at android.support.v7.internal.widget.TintTypedArray.getDrawable(TintTypedArray.java:62) [MonoDroid] at android.support.v7.widget.Toolbar.<init>(Toolbar.java:249) [MonoDroid] at android.support.v7.widget.Toolbar.<init>(Toolbar.java:191) [MonoDroid] ... 29 more [libc] Fatal signal 6 (SIGABRT) at 0x0000736e (code=-6), thread 29550 (yvanity.android)

    Sunday, March 29, 2015 3:56 AM
  • User62557 posted

    Sorry, not sure what's the issue but I redownload the studio/android to install and it work. Think my studio auto update have some issues.

    Sunday, March 29, 2015 4:52 AM
  • User82697 posted

    I am also facing the same issue.Any help?

    Wednesday, May 13, 2015 8:19 AM
  • User82697 posted

    Can someone please let me know about any fix for this issue??

    Wednesday, May 13, 2015 5:35 PM
  • User93210 posted

    Also the same issue... :(

    Monday, September 14, 2015 7:43 PM
  • User62557 posted

    If I remember correctly, you need to make sure the view files are pointing to the correct toolbar widget. For my case, I reinstall everything and change the layout theme to default and it work. So I guess there are some mapping issue with the theme?

    Friday, September 25, 2015 1:45 AM
  • User151288 posted

    Can someone please let me know about any fix for this issue??

    Monday, October 12, 2015 7:09 AM
  • User151288 posted

        <android.support.v7.widget.Toolbar
                android:id="@+id/action_bar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:navigationContentDescription="@string/abc_action_bar_up_description"
                style="?attr/toolbarStyle"/>
    
        <android.support.v7.internal.widget.ActionBarContextView
                android:id="@+id/action_context_bar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:theme="?attr/actionBarTheme"
                style="?attr/actionModeStyle"/>
    
    Monday, October 12, 2015 8:00 AM
  • User192655 posted

    check in manifest if the themes are declared :smile:

    Tuesday, March 8, 2016 4:47 PM
  • User192655 posted

    application android:label="ASM" android:theme="@style/MyTheme"

    Tuesday, March 8, 2016 4:48 PM
  • User212522 posted

    the same issue....

    Wednesday, April 13, 2016 2:48 AM
  • User71746 posted

    same problem here... https://forums.xamarin.com/discussion/67000/error-inflating-class-android-support-v7-widget-toolbar-after-updaring-to-v7-appcompat-version-23-3

    Thursday, June 16, 2016 7:29 AM
  • User246258 posted

    I also did everything in example but didn't work so i added this

    ... MainLauncher = true, Theme ="@style/AppTheme", ... and worked!!!

    Thursday, August 25, 2016 6:18 AM
  • User285342 posted

    i got Error in xamarin cross plateform

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

    please help me

    Wednesday, January 18, 2017 5:51 AM
  • User280247 posted

    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 "C:\Users\\AppData\Local\Xamarin"

    THIS IS FOR WINDOWS NOT SURE ABOUT IF YOU ARE DEVELOPING IN MAC MACHINE

    Wednesday, January 18, 2017 6:35 AM
  • User88553 posted

    @ManojShukla said: 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 "C:\Users\\AppData\Local\Xamarin"

    THIS IS FOR WINDOWS NOT SURE ABOUT IF YOU ARE DEVELOPING IN MAC MACHINE

    Still doesn't work for me. All I did was create a blank project and I get same error.

    Thursday, January 19, 2017 9:55 AM
  • User88553 posted

    @NurlanIbikeev said: I also did everything in example but didn't work so i added this

    ... MainLauncher = true, Theme ="@style/AppTheme", ... and worked!!!

    I can't even compile, since I don't have AppTheme and only the default MainTheme, found in the blank project.

    Thursday, January 19, 2017 9:57 AM
  • User88553 posted

    I found that this error occurs only when running on an API 22 virtual device. It doesn't occur when I deploy to an API 19 virtual device. I'm using the default blank project generated by VS2015 without any modifications.

    Thursday, January 19, 2017 11:22 AM
  • User259500 posted

    @MichaelCheng I had same problem with you. I had to uninstall the XF, delete bin/obj folder, restart VS, install back the XF, rebuild whole solution. Try if it fixes your problem

    Monday, January 23, 2017 4:19 PM
  • User88553 posted

    @red49 said: @MichaelCheng I had same problem with you. I had to uninstall the XF, delete bin/obj folder, restart VS, install back the XF, rebuild whole solution. Try if it fixes your problem

    Guess what, @red49. It works! Thanks a lot! :)

    Monday, January 23, 2017 4:56 PM
  • User189128 posted

    @red49, Same problem here. You solved! Thanks!

    Monday, January 30, 2017 3:50 PM
  • User191984 posted

    By default there are 2 dependencies missing in clean xf droid project: 1. Xamarin.Android.Support.Animated.Vector.Drawable 2. Xamarin.Android.Support.Vector.Drawable you need to add them using npm and everything will work :wink:

    Sunday, February 12, 2017 10:06 PM
  • User106514 posted

    @red49 said: @MichaelCheng I had same problem with you. I had to uninstall the XF, delete bin/obj folder, restart VS, install back the XF, rebuild whole solution. Try if it fixes your problem

    With XF I assume you mean Xamarin Forms? Does anyone have this issue and is not using Xamarin Forms?

    Friday, June 30, 2017 9:28 PM
  • User319321 posted

    Helo All, I had same issue, but resolved smoothly by updating xamarin forms version for all plateforms(PCL,Android, IOS) from version 2.3.3.180 to 2.3.3.193. I think this error comes always for android version 5.x and may be the region for that is xamarin 2.3.3.180 is not compatible with Xamarin.Android.Support.v7.AppCompat( version 23.3.0) in android 5.x, Try to update xamarin version(you can downgrad or upgrad both ) can work and restart VS after.

    Friday, October 6, 2017 1:10 PM