Skip to content Skip to sidebar Skip to footer

Java.lang.noclassdeffounderror: Android.support.v4.view.layoutinflatercompathc In Android Studio

i am new to android studio i am doing one sample application in android studio, when i run the application 5.0 it's working fine but 5.0 below it's throw's this Execption can

Solution 1:

It looks like you have enabled multidex, but you are not using the multidex library.

Lollipop (API 21) introduced native support for multidexing, but for previous versions of Android you must use the multidex support library to properly support multidexing.

First, add the dependency to your build.gradle:

compile'com.android.support:multidex:1.0.0'

Second, you need to enable multidex in your application code. If you are not using a custom Application class already, you can do so by registering the MultiDexApplication class in your manifest like so:

<application...android:name="android.support.multidex.MultiDexApplication">
    ...
</application>

If you are using a custom application class, you should enable multidex in attachBaseContext() like so:

@OverrideprotectedvoidattachBaseContext(Context base) {
    super.attachBaseContext(base);

    MultiDex.install(this);
}

Source: Building Apps with over 65k Methods

Post a Comment for "Java.lang.noclassdeffounderror: Android.support.v4.view.layoutinflatercompathc In Android Studio"