CoordinatorLayout not working in Android Studio 3.1.3?

I was having the same problem. I tried following steps from here, but still the problem persists. I think it is a common issue in android studio 3.0+, Hopefully they will fix it next update. In the Android Studio Preview 3.2 it works fine. Download Android Studio Preview and visit here to learn how to run it alongside with Android Studio stable version

enter image description here

Or you can try to lower your design library version to 27. (And the compile sdk version also to 27)

dependencies { implementation 'com.android.support:appcompat-v7:27.0.2' implementation 'com.android.support:design:27.0.2' }