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
Just in case someone else comes from Google and makes the same mistake I did, it's layout_behaviOr
, not layout_behavioUr
.
Replace "app:layout_behavior="@string/appbar_scrolling_view_behavior" with app:layout_behavior="android.support.design.widget.AppBarLayout$ScrollingViewBehavior"
Add compile com.android.support:design:23.0.1
into your build.gradle
dependencies.
if you not added android material yet first add this line in your dependencies in build.gradle file
implementation 'com.google.android.material:material:1.0.0'
then use this attribute instead
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
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'