Error inflating class android.support.design.widget.NavigationView

Android Studio3.3

主要错误在navigation_header这个布局里,layout_height ,开始这么写的:android:layout_height="?android:attr/actionBarSize" 改成:android:layout_height="?attr/colorPrimaryDark" 这个就好了

主要布局R.layout.activity_card_view:



    

        

            

            
        
    

    
    






复制代码

navigation_header :




复制代码

drawer_view:

    

    

    

    






复制代码





app gradle 配置:
apply plugin: 'com.android.application'
复制代码

android { compileSdkVersion 28 defaultConfig { javaCompileOptions { annotationProcessorOptions { includeCompileClasspath true } } applicationId "com.example.java.mypermissions" minSdkVersion 19 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } }

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
复制代码

} ext{ supportLibVersion = '27.1.1' }

dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation "com.android.support:appcompat-v7:${supportLibVersion}"
implementation "com.android.support:design:${supportLibVersion}"
implementation "com.android.support:cardview-v7:${supportLibVersion}"
implementation "com.android.support:recyclerview-v7:${supportLibVersion}"
复制代码

// implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:support-v4:27.1.1' implementation 'com.android.support.constraint:constraint-layout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' implementation 'com.github.hotchemi:permissionsdispatcher:2.1.3' annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:2.1.3' //Snackbar // implementation 'com.android.support:design:27.1.1' }

代码:github.com/acridin/myP…

你可能感兴趣的:(Error inflating class android.support.design.widget.NavigationView)