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

前端 未结 11 1129
南方客
南方客 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:28

    I solved the problem now :)

    1. Open [File] -> [Project Structure...]

    2. Select [app] in the left pad

    3. Select [Dependencies] in the right tabs

    4. Click [+] button on the right side

    5. Select [1 Library dependency]

    6. Choose [com.android.support:design ~~]

    7. Click [OK] button and so on

    Result: library added in [Project's External Libraries]

    ------ edit -----------------------------------

    You can also add this External library in build.gradle(Module:app)

    press Alt+Enter in build.gradle(Module:app)

    -> add library dependency

    -> choose what you need

    and press "Sync Now" positioned up right corner

提交回复
热议问题