簡體   English   中英

android.view.InflateException:二進制XML文件第0行:二進制XML文件第0行:膨脹類android.support.design.widget.CoordinatorLayout時出錯

[英]android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class android.support.design.widget.CoordinatorLayout

為什么當我運行項目時出現此錯誤? 這是我第一次遇到這種問題! 所以我希望你能幫助我!

java.lang.RuntimeException:無法啟動活動: android.view.InflateException:二進制XML文件行0:二進制XML文件行0:膨脹類android.support.design.widget.CoordinatorLayout`

這是代碼:

嚴重:

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'

}

這是因為CoordinatorLayout 是在版本24.1.0中添加的 因此,您需要將支持庫設計更新為版本24.1.0 最好使用最新的穩定版支持庫,即26.1.0 (存在版本27,但API狀態仍處於預覽模式)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM