Tried your code, the problem is with the 23.4.0 library.
Upgrade to 24.+ , there's no error in that lib.
For example :
compileimplementation 'com.android.support:appcompat-v7:24.2.1' // appcompat library compileimplementation 'com.android.support:design:24.2.1' You need to change the compile version to 24 too.
compileSdkVersion 24