No resource identifier found for attribute 'layout_behavior' in package

后端 未结 11 1002
不知归路
不知归路 2020-11-30 05:43

My application worked fine until I tried to add a library to it. After I added the library, Android Studio gives me the following error:

Error:(26) No

11条回答
  •  悲哀的现实
    2020-11-30 06:14

    Note: The versions have changed by now, so replace below versions with the most recent ones.

    The accepted answer gets rid of the error in case layout_behavior is not needed, however if you actually want to use:

    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    

    Make sure to add the proper dependency to the build.gradle file of your module:

    apply plugin: 'com.android.library'
    
    android {
        compileSdkVersion 23
        buildToolsVersion "21.1.2"
    
       //Other stuff....
    }
    
    dependencies {
    
        //Importing the design library fixes the build
        compile 'com.android.support:design:23.1.0'
    
        //Other libraries....
    }
    

    I.e. add this line to your dependencies:

    compile 'com.android.support:design:23.1.0'
    

提交回复
热议问题