Can't find android.support.design.widget.Snackbar in support design library

前端 未结 11 953
南方客
南方客 2021-02-02 05:31

I develop own library module where I use Snackbar.

Here is my Gradle file:

apply plugin: \'com.android.library\'

android {
    compileSdkV         


        
11条回答
  •  悲哀的现实
    2021-02-02 06:23

    To get the the Snackbar into our Android proyect just add the reference of support:design library inside the build.gradle file :

    dependencies {
        ...
        ...
        compile 'com.android.support:design:25.0.1'
    }
    

    Be sure to sync your project with the gradle files , this will fix your problem.


    Your error message is:

    error: package android.support.design.R does not exist

    be sure to have the correct import:

    import android.support.design.widget.Snackbar;
    

提交回复
热议问题