It worked when I downgrade the support appcompat
gradle dependency, like follwing :
implementation 'com.android.support:appcompat-v7:27.0.2'
previously it was
implementation 'com.android.support:appcompat-v7:27.1.0'
OR
Also this can be fixed by just adding support design dependency
of version 27.1.0 or above to your app level build.gradle
as following :
implementation 'com.android.support:design:27.1.0'