I develop own library module where I use Snackbar
.
Here is my Gradle file:
apply plugin: \'com.android.library\'
android {
compileSdkV
You must add the design dependency in your gradle file (module app) according to
implementation "com.google.android.material:material:1.1.0-alpha06"
implementation "com.android.support:design:28.0.0"
If you are using Support libraries, you can visit Support Library Packages | Android Developers, for the latest Design Support Library version. If you're new to AndroidX and want to use it, you can find more information about migrating to the new dependencies here.
Source: http://android-developers.blogspot.co.il/2015/05/android-design-support-library.html
(Scroll all the way down)