Error when using any Android Design Support Library Elements

前端 未结 5 1119
小鲜肉
小鲜肉 2020-11-30 03:52

Error inflating anything from the design support library

xml



        
5条回答
  •  南方客
    南方客 (楼主)
    2020-11-30 04:40

    In addition to Emmanuel's answer you could be facing the following problem.

    It seems like the design library components need a style which is based on an AppCompat Theme. So try to use "Theme.AppCompat.[...]" as a parent in your style.xml.

    Example:

    
    
    
    
    

    Then add the following to your build.gradle as well:

    compile 'com.android.support:appcompat-v7:22.2.0'
    

    Additionally you should update the following lines in your gradle as well:

    classpath 'com.android.tools.build:gradle:1.2.3'
    compileSdkVersion 22
    buildToolsVersion '22.0.1'
    targetSdkVersion 22
    

提交回复
热议问题