0

why when I run my project I get this error? It is the first time that I have this kind of issue! So I hope that you can help me!

java.lang.RuntimeException: Unable to start activity:android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class android.support.design.widget.CoordinatorLayout`

This is the code:

GRADLE:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
//    buildToolsVersion "24.0.1"
    defaultConfig {
        applicationId "info.androidhive.navigationdrawer"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:24.0.0-beta1'
    compile 'com.android.support:design:24.0.0-beta1'
    compile 'com.android.support:support-v4:24.0.0-beta1'
    testCompile 'junit:junit:4.12'
    compile 'com.github.bumptech.glide:glide:3.7.0'

}
ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
Sisso
  • 229
  • 1
  • 5
  • 12
  • Post the full stacktrace - the answer is likely in one of those "Caused by" nested exceptions. – laalto Dec 01 '17 at 11:10
  • Use AppCompatActivity instead of Activity . Post your code and style.xml instead. – ADM Dec 01 '17 at 11:13
  • Possible duplicate of [Error inflating class android.support.design.widget.CoordinatorLayout](https://stackoverflow.com/questions/30571097/error-inflating-class-android-support-design-widget-coordinatorlayout) – ADM Dec 01 '17 at 11:16
  • @ADM https://pastebin.com/jd6Br8qk – Sisso Dec 01 '17 at 11:23
  • Put your activity's style in question from style.xml – ADM Dec 01 '17 at 11:25
  • @ADM https://pastebin.com/xECTEjuN – Sisso Dec 01 '17 at 11:25
  • At first its looks like a Style error. Post the full stacktrace . Do not add links in comment while you can edit your question . – ADM Dec 01 '17 at 11:28
  • @ADM can i post you link project? so you can downloaded it and can help me? – Sisso Dec 01 '17 at 11:45

1 Answers1

0

This is because CoordinatorLayout is added in version 24.1.0. So, you need to update your support library design to version 24.1.0. You're better to use the latest stable of support library, which is 26.1.0 (there is version 27, but the API status is still in preview mode).

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96