Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: android.support.design.internal.NavigationMenuItemView

I'm testing my project on MotoG (Lollipop 5.1) and a have problem that didn't have on XperiaT2 (KitKat 4.4). The error log is:

 java.lang.NoClassDefFoundError: android.support.design.internal.NavigationMenuItemView
            at java.lang.Class.classForName(Native Method)
            at java.lang.Class.forName(Class.java:309)

I'm using android.support:design library but not instanciate the NavigationView, I tried to use

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

and

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

And didn't solve. Maybe the problem is related with a previously problem with support:appcompat library that this error happened when I tried use a 23.1.1 lower version

NoClassDefFoundError: android.support.v4.hardware.fingerprint.FingerprintManagerCompatApi23$1

My actual Gradle configuration is:

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.1'

    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 21
    }
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'com.android.support:design:22.2.0'
    compile 'com.android.support:cardview-v7:23.0.1'
    compile 'com.android.support:recyclerview-v7:23.0.1'

Please some help.

UPDATE

When I try to use

buildToolsVersion '23.0.2'
'com.android.support:appcompat-v7:23.1.1'
'com.android.support:design:23.1.1'

I have error to render the preview on android studio

Exception Details java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library.

Even using my theme this way

<style name="MyTheme" parent="Theme.AppCompat.Light">
like image 859
7xRobin Avatar asked Apr 26 '26 16:04

7xRobin


1 Answers

Maybe you could try the following code and try again:

./gradlew clean

Or this:

gradle clean

According to some links I search around, may these do some tricks for you.

like image 61
Anthonyeef Avatar answered Apr 29 '26 07:04

Anthonyeef