Xwire
Xwire

Reputation: 77

Crash related to NavigationView on Android 4.4.2

The question - Does anyone know what could be causing this error on 4.4.2?

The Device in question is a Galaxy Note 2. The device running 6.0.1 is an Xperia Z2.

When trying to run/compile this app on a device with 4.4.2 it crashes on startup.

This is the error log - Error Log.

The main error being "Binary XML file line #16: Error inflating class android.support.design.widget.NavigationView".

This app compiles and runs as expected on a device running 6.0.1. I started the project using the built in Navigation Drawer example in Android Studio. It ran fine for a while and then after a few changes I went back to the device running 4.4.2 and it would die on start up. I've been looking online for someone with the same error but nothing is relating to my case. It mentions the error on line 16 but I can't find any line that seems wrong. It only points the error to setContentView in the Main Activity. I'll link all related XML files. But nothing I've found is out of place and I'd really like a step in the right direction.

I'm assuming I'm using a feature not supported on the older device but I can't figure what that is.

I created a new Example NavDrawer project and copied the Menu Layout and Header layout into the project and it still crashes on start. I'm guessing it might be as Style error.

This is my Build.Gradle file. Build.gradle

This is the layout with the NavigationView in it. Main Layout

This is the Header Layout. Header Layout

This is the Menu Layout. Menu Layout

This is the Style.xml. Style.xml

This is the Style21.xml. Style21

This the Main Activity. MainActivity

Any help is very much appreciated.

Upvotes: 1

Views: 562

Answers (1)

Austin K.
Austin K.

Reputation: 77

Check to make sure that you don't have drawable's located only in the v-21 folder as that folder is only accessible by v-21 and up.

Android 4.4.2 is v-19 so that could be why it works on version 5.0 and higher.

Upvotes: 1

Related Questions