Error inflating class android.support.design.widget.NavigationView

I followed the tutorial of the new NavigationView component in the design support library and cannot go through this error message:

Error inflating class android.support.design.widget.NavigationView 

I tried every workaround here

Error using any elements of the Android design support library

but the error message still exists.

XML

 <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" > <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" > <include layout="@layout/toolbar" android:id="@+id/mainToolBar" /> <fragment android:name="com.ais.cherry.fragment.LoginFragment" android:id="@+id/loginFragment" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/mainToolBar" /> <fragment android:name="com.ais.cherry.fragment.WaterFallFragment" android:id="@+id/mainFragment" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/mainToolBar" /> <fragment android:name="com.ais.cherry.fragment.SearchFragment" android:id="@+id/searchFragment" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/mainToolBar" /> <fragment android:name="com.ais.cherry.fragment.ChatMainFragment" android:id="@+id/chatMainFragment" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/mainToolBar" /> <fragment android:name="com.ais.cherry.fragment.ProfileFragment" android:id="@+id/profileFragment" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/mainToolBar" /> <android.support.design.widget.NavigationView android:id="@+id/nav_view" android:layout_width="240dp" android:layout_height="match_parent" android:layout_gravity="start" android:background="@android:color/white" app:itemTextColor="#212121" app:headerLayout="@layout/drawer_header" app:menu="@menu/drawer" /> </android.support.v4.widget.DrawerLayout> 

build.gradle

 buildscript { repositories { mavenCentral() maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'io.fabric.tools:gradle:1.+' classpath 'com.android.tools.build:gradle:1.2.3' } } compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId "com.ais.cherry" minSdkVersion 16 targetSdkVersion 22 multiDexEnabled true renderscriptTargetApi 22 renderscriptSupportModeEnabled true } dependencies { compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.android.support:support-v4:22.2.0' compile 'com.android.support:design:22.2.0' compile 'com.android.support:recyclerview-v7:22.2.0' } 

Project build.gradle

 buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' } } 

styles.xml

 <?xml version="1.0" encoding="utf-8"?> 

 <!-- Base application theme. --> <style name="AppTheme" parent="AppTheme.Base"> </style> <style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:windowActionBarOverlay">true</item> <item name="android:windowActionModeOverlay">true</item> <item name="android:actionModeStyle">@style/AppTheme.ActionModeStyle</item> <item name="android:windowActionBar">false</item> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> <item name="android:windowNoTitle">true</item> <!-- Support library compatibility --> <item name="windowActionBarOverlay">true</item> <!-- ActionBar color --> <item name="colorPrimary">#E91E63</item> <!-- Status bar color --> <item name="colorPrimaryDark">#C2185B</item> <!-- Window color --> <item name="android:windowBackground">@color/white</item> <!-- ActionBar title text --> <item name="android:titleTextStyle">@style/AppTheme.MyActionBarTitleText</item> <item name="colorAccent">#9E9E9E</item> <item name="drawerArrowStyle">@style/AppTheme.MyDrawerArrowStyle</item> <!-- color for actionMenu--> <item name="actionMenuTextColor">#FFFFFF</item> <item name="android:actionMenuTextColor">#FFFFFF</item> <!-- android:textColorSecondary is the color of the menu overflow icon (three vertical dots) --> <item name="android:textColorPrimary">#212121</item> <item name="android:textColorSecondary">#FFFFFF</item> <!--Navigation bar color--> <item name="android:navigationBarColor">#E91E63</item> <!--Status bar color--> <item name="android:statusBarColor">#C2185B</item> </style> 

Any help would be appreciated!

Edit - add the menu @ / box and @ menu / drawer_header and stacktrace

drawer.xml

 <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/nav_first_fragment" android:icon="@drawable/home_view" android:checked="true" android:title="@string/main"/> <item android:id="@+id/nav_second_fragment" android:icon="@drawable/comment_view" android:title="@string/chat"/> <item android:id="@+id/nav_third_fragment" android:icon="@drawable/user_view" android:title="@string/profile"/> <item android:title="@string/search"> <menu> <item android:title="@string/clothes"/> <item android:title="@string/pants"/> </menu> </item> </group> </menu> 

drawer_header.xml

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="192dp" android:background="?attr/colorPrimaryDark" android:padding="16dp" android:theme="@style/ThemeOverlay.AppCompat.Dark" android:gravity="bottom"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/title" android:textColor="@android:color/white" android:textAppearance="@style/TextAppearance.AppCompat.Body1"/> </LinearLayout> 

StackTrace (only a part of them)

He eliminated three exceptions, as shown below: everything indicates that the problems are caused by the "setContentView (layout)" line in the layout.xml file.

 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ais.cherry/com.ais.cherry.activity.FirstActivity}: android.view.InflateException: Binary XML file line #32: Error inflating class android.support.design.widget.NavigationView Caused by: android.view.InflateException: Binary XML file line #32: Error inflating class android.support.design.widget.NavigationView Caused by: java.lang.reflect.InvocationTargetException Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0 
+75
android android-support-library androiddesignsupport
Jun 08 '15 at 12:39 on
source share
23 answers

Actually, it is not a primarycolortext , but an update or redefinition of dependencies. This problem is likely to occur if the version of the appcompat library library and the design support library do not match.

Compliance condition example

 compile 'com.android.support:appcompat-v7:23.1.1' // appcompat library compile 'com.android.support:design:23.1.1' //design support library 
+78
Nov 24 '15 at 20:20
source share

I had a similar error. When i use

 <style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">#673AB7</item> <item name="colorPrimaryDark">#512DA8</item> <item name="colorAccent">#00BCD4</item> <item name="android:textColorPrimary">#212121</item> <item name="android:textColorSecondary">#727272</item> </style> 

works for me when I remove android: textColorPrimary and android: textColorSecondary themes.

 <style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">#673AB7</item> <item name="colorPrimaryDark">#512DA8</item> <item name="colorAccent">#00BCD4</item> </style> 

Try working with a very simple application theme to get started with.

EDIT:

This tutorial will help. I understand that using "android: textColorPrimary" requires a minimum level of api 21. Using the same tag without "android:" uses the design support library. Any support library widget will try to find the "textColorPrimary" element instead of "android: textColorPrimary", and if it cannot find the same, it will throw the above error.

+45
Jun 09 '15 at 17:48
source share

I also had a mistake. In my case, some resources were only in drawable-v21. Copy these resources to the drop-down folder. This solved the problem for me.

 Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0 

This is the main problem.

+35
May 28 '16 at 9:19
source share

Well, therefore, I tried to correct this error. And no one worked for me. I could not find a solution. Scenario:

I was just going to make the Navigation Drawer Project inside Android Studio 2.1.2. And when I try to change the default Android icon in nav_header_main.xml , I got some strange errors. I found out that I entered the PNG logo in ...\app\src\main\res\drawable-21 . When I try to put my PNG logo in ...\app\src\main\res\drawable bam! All the weird mistakes go away.

Below are some stack traces when I put PNG in the drawable-21 folder:

 08-17 17:29:56.237 6644-6678/myAppName E/dalvikvm: Could not find class 'android.util.ArrayMap', referenced from method com.android.tools.fd.runtime.Restarter.getActivities 08-17 17:30:01.674 6644-6644/myAppName E/AndroidRuntime: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{myAppName.MainActivity}: android.view.InflateException: Binary XML file line #16: Error inflating class <unknown> at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2372) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424) at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3956) at android.app.ActivityThread.access$700(ActivityThread.java:169) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1394) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5433) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:924) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691) at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #16: Error inflating class <unknown> at android.view.LayoutInflater.createView(LayoutInflater.java:613) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687) at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java:396) at android.view.LayoutInflater.inflate(LayoutInflater.java:352) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at edu.uswat.fwd82.findmedoc.MainActivity.onCreate(MainActivity.java:22) at android.app.Activity.performCreate(Activity.java:5179) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2336) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424) at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3956) at android.app.ActivityThread.access$700(ActivityThread.java:169) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1394) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5433) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:924) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:417) at android.view.LayoutInflater.createView(LayoutInflater.java:587) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687) at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java:396) at android.view.LayoutInflater.inflate(LayoutInflater.java:352) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at edu.uswat.fwd82.findmedoc.MainActivity.onCreate(MainActivity.java:22) at android.app.Activity.performCreate(Activity.java:5179) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2336) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424) at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3956) at android.app.ActivityThread.access$700(ActivityThread.java:169) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1394) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5433) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:924) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691) at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #14: Error inflating class ImageView at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java:396) at android.support.design.internal.NavigationMenuPresenter.inflateHeaderView(NavigationMenuPresenter.java:189) at android.support.design.widget.NavigationView.inflateHeaderView(NavigationView.java:262) at android.support.design.widget.NavigationView.<init>(NavigationView.java:173) at android.support.design.widget.NavigationView.<init>(NavigationView.java:95) at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:417) at android.view.LayoutInflater.createView(LayoutInflater.java:587) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687) at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java:396) at android.view.LayoutInflater.inflate(LayoutInflater.java:352) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at edu.uswat.fwd82.findmedoc.MainActivity.onCreate(MainActivity.java:22) at android.app.Activity.performCreate(Activity.java:5179) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2336) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424) at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3956) at android.app.ActivityThread.access$700(ActivityThread.java:169) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1394) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5433) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:924) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at android.content.res.ResourcesEx.getThemeDrawable(ResourcesEx.java:459) at android.content.res.ResourcesEx.loadDrawable(ResourcesEx.java:435) at android.content.res.TypedArray.getDrawable(TypedArray.java:609) at android.widget.ImageView.<init>(ImageView.java:120) at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:57) at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:53) at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:106) at android.support.v7.app.AppCompatDelegateImplV7.createView(AppCompatDelegateImplV7.java:980) at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(AppCompatDelegateImplV7.java:1039) at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:44) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java: 

As you can see, the above stack trace includes:

android.support.design.widget.NavigationView.inflateHeaderView (NavigationView.java:262) in android.support.design.widget.NavigationView. (NavigationView.java:173) in android.support.design.widget.NavigationView. (NavigationView.java:95)

+14
Aug 17 '16 at 13:00
source share

I had the same error, I resolved it by adding app:itemTextColor="@color/a_color" in my navigation view:

 <android.support.design.widget.NavigationView android:id="@+id/navigation_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="left" app:headerLayout="@layout/layout_drawer_header" app:menu="@menu/drawer_menu" app:itemTextColor="@color/primary"/> 

You can use android:textColorPrimary and android:textColorSecondary in your theme using this method.

+13
Jun 11 '15 at 15:37
source share

I decided to lower it in gradle from

 compile 'com.android.support:design:23.1.0' 

to

 compile 'com.android.support:design:23.0.1' 

It seems that I always have problems when I update any component of Android Studio. Tired of it.

+11
Nov 10 '15 at 10:13
source share

None of the above fixes worked for me.

What worked for me was changing

 <item name="android:textColorSecondary">#FFFFFF</item> 

to

 <item name="android:textColorSecondary">@color/colorWhite</item> 

You obviously need to add colorWhite to your color. xml

+6
May 31 '16 at 10:33
source share

As Parag Nike correctly mentions (and Lạng Hoàng expands), a problem arises when setting textColorPrimary to a value other than a list of color states. That way you can set textColorPrimary as a list of states. There is a problem in the Android error tracking system that colorPrimary is a list of states with only one color: https://code.google.com/p/android/issues/detail?id=172353.

So, for your theme in styles.xml:

 <style name="Base.Theme.Hopster" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> <item name="android:textColorPrimary">@color/primary_color_statelist</item> </style> 

And the actual file primary_color_statelist.xml:

 <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- This is used when the Navigation Item is checked --> <item android:color="@color/primary_text_selected" android:state_checked="true" /> <!-- This is the default text color --> <item android:color="@color/primary_text" /> </selector> 
+5
Aug 31 '15 at 19:32
source share

The following steps will fix this error.

  • Find the widget that causes the error.
  • Go to the layout file where this widget is declared.
  • Check all resources (Drawables, etc.) Used in this file.
  • Then make sure that the resource is in all versions of drawables (drawable-v21, drawable, etc.)

Hurrah !!

+5
Feb 22 '18 at 17:58
source share

For me, I have come across this error many times,

Error inflating class android.support.design.widget.NavigationView # 28 and # 29

The solution that works for me is that you should match the support support library and your appcompat support library.

compile 'com.android.support:appcompat-v7:23.1.1'

compile 'com.android.support:design:23.1.1'

They should match for me. :) This works for me!

+4
Dec 29 '15 at 12:40
source share

Only for those who still cope with this problem. I ran into the same problem, but all the solutions here do not work for me.

Just take alook in the NavigationView class using cue from logcat, I found that the problem came from this line of code:

 itemTextColor = this.createDefaultColorStateList(16842806); 

So, this is similar to the itemTextColor mentioned in Aenur56. So I tried with Aenur56 solution, but it does not work.

Take a look at the line of code above, I noticed that there is a ColorStateList. So I create it, then set for itemTextColor, then it works.

 <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="#00FF00" android:state_checked="true" /> <item android:color="#000000" /> </selector> 

Hope this helps!

+3
Jul 06 '15 at 4:20
source share

None of the above solutions helped me. I found this on some other web page and it worked for me - "In project.properties from the design library, target 21 or the highest available is set, then a clean design library, appcomapt and your project and enjoy"

Hope this helps!

+3
Jul 16 '15 at 12:38
source share

In my case, I had the same error when I ran the application on the device version 19 KitKat API. I figured out the problem; I had some drawing resources that were in the drawable-v21 directory (which is used for versions from Lollipop API 21). I just put the same resources in the "Drawable" folder to work with the API version below 21. This works. You can put it in the appropriate directory

+3
Jul 18 '18 at 6:08
source share

If you are already androidx on androidx , you should change the xml layout from

 <android.support.design.widget.NavigationView ... /> 

at

 <com.google.android.material.navigation.NavigationView ... /> 
+2
Jul 01 '18 at 13:19
source share

I had the same problem after updating the support library, and none of the answers worked for me. Finally, I decided to download the latest build tools and upgrade in build.gradle to buildToolsVersion "23.0.1"

+1
Dec 04 '15 at 4:02
source share

BETTER I UPDATED com.android.support:appcompat-v7:23.1.0

as @Ton said to lower compile 'com.android.support:design:23.1.0'

BUT Why not upgrade com.android.support:appcompat-v7:23.1.1

The latest update has improved for me, enjoy

 compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' 

So why use an older library. I think it’s better to use design and compact modernization now.

+1
Jul 01 '16 at 9:20
source share

This error may be caused for the reasons listed below.

  • This problem is likely to occur when the version of your application library and design support library does not match. Compliance condition example

      compile 'com.android.support:appcompat-v7:24.2.0' // appcompat library compile 'com.android.support:design:24.2.0' //design support library 
  • If your stylesheet theme file has only these two,

      <item name="colorPrimary">#4A0958</item> <item name="colorPrimaryDark">#4A0958</item> 

then add ColorAccent. It should look something like this.

  <style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">#4A0958</item> <item name="colorPrimaryDark">#4A0958</item> <item name="colorAccent">#4A0958</item> </style> 
+1
Sep 12 '16 at 6:12
source share

I also had the same problem, after looking at almost 3 hours, I found out that the problem was in my drawable_menu.xml file, it was spelled incorrectly: D

+1
Nov 24 '16 at 7:36
source share

Make sure that your drawing elements for the menu are in the correct folder, mine, where it is placed in drawablev21, therefore, this caused a null pointer to the resource.

Fixed bug with moving my icons to drawables folder

+1
Feb 17 '18 at 8:18
source share

One thing to check is that you correctly applied your theme in the AndroidManifest.xml file. In my case, I omitted the android: theme attribute. For example:

 <application ... android:theme="@style/Your.Theme.Here" ... > 
0
Apr 19 '16 at 12:54 on
source share

A general way to solve problems like Error inflating class X :

  1. check the trace of the reason stack and there should be a Resources$NotFoundException like this:
 Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f0b0066 at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:190) at android.content.res.Resources.loadXmlResourceParser(Resources.java:2094) at android.content.res.Resources.getLayout(Resources.java:1111) at android.view.LayoutInflater.inflate(LayoutInflater.java:424) 
  1. Resource ID is actually an exact integer from the generated R.java file.
  2. Find 0x7f0b0066 which will point to an XML file that cannot be inflated (found).
  3. In most cases, this is due to the fact that the layout catalog does not have this resource, but in some layout-XXX .
  4. And the solution is to put the resource in all the necessary directories. Or at least in layout .
0
Jul 20 '18 at 13:59
source share

I found a solution ... if you used app: srcCompat, change to android: src this solution worked for me :)

0
Dec 15 '18 at 11:57
source share

This is a strange but clean project, and the remodeling project worked for me.

0
Apr 03 '19 at 7:41
source share



All Articles