no resource id found for app:layout_scrollflags from CollapsingToolbarLayout

only importing the design library jar file is not enough. You need to import resource of android-design-library project while the jar file only contains class files.

Do as I say:

  1. import android-design-library project. The project is at "sdk/extras/android/support/design/". And set it as a library project if it is not.
  2. import the above project into your main project as a library.

You have to do this, because xmlns:app="http://schemas.android.com/apk/res-auto" means your need local resources from your library project or the current project, in this case, it means you need resources from the library project of android-design-library.


try this

add app level build.gradle

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

then Build -> Rebuild Project


As others have stated you definitely need to add Design Support Library dependency to your android app. Simplest way is to add following to app level gradle file -

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

However couple of points to note-

  1. This support library should not use a different version than the compileSdkVersion. Since I was using compileSdkVersion 25 I had to use compile 'com.android.support:design:25.3.1' and not compile 'com.android.support:design:24.2.1'
  2. Using the design library requires using theme.appcompat or a descendant. If you want add actionbar to your activity then your theme should be AppCompat. In my case I was using android:Theme.Material due to which it was failing. Changing it to Theme.AppCompat.Light.NoActionBar worked for me.