Error inflating class CollapsingToolbarLayout
I had the same issue, @Shumin's code is effective too but it is better to remove conflicts instead of bypassing them. To find the conflict -
In Android Studio, open
Terminal
and entergradlew app:dependencies
.Check the dependencies tree and see which library is causing conflict
Update:-
To check for conflicts, check the dependencies of each library and see if you aren't using the same dependency in some other library but with different version. For example, in the image below, com.android.support:appcompat-v7
is dependent on com.android.support:support-vector-drawable:23.4.0
. If you find some other library depending on com.android.support:support-vector-drawable
but the version is different, then you have found your conflict.
i found two solutions,
first one is
app:statusBarScrim="@null"
second is to force app
compile ('com.android.support:support-v4:23.4.0') {
force = true;
}
Sources taken from here
I found a solution May it work try it:
add below code in gradle build file
compile ('com.android.support:support-v4:23.4.0'){
force = true;
}
Seems like it is having version conflict issue. All support library must be of same version. However, I didn't use v4 support library before and it works. I don't know why updatimg android studio to 2.1.1 causes the issue. I just force all v4 library to the same as other support libraries.
I know there is an accepted answer already, BUT it is not working (or no longer working).
I spent a couple of hours researching on this error, what I came up was this.
First, due to initial release of Android Nougat also known as Android 7.0 (API 24) compileSdkVersion 24 is now available. To do that, you have to update your sdk. Step 1
Second, is to update your gradle files (internet connection required). Step 2
Also Update this part of app.gradle
Third (optional) Clean Project, Build Project (Both under Build Tab)
I hope this helped someone out there and save some few hours of researching.
Cheers / Happy coding