Import new Android Design Support library

2019-06-16 05:48发布

问题:

Hi i'am trying to import the new android support library like this com.android.support:support-design:22.0.0 but i got this error after sync the gradle : failed to find

回答1:

You have to update your Android Support Repository in SDK Manager, then just add this dependency to your build.gradle:

compile 'com.android.support:design:22.2.0'

com.android.support:support-design:22.0.0 is wrong.



回答2:

The docs has it wrong.

It should actually be 'com.android.support:design:22.2.0'

as mentioned in their official blog.



回答3:

With gradle 3 it should be:

dependencies {
    implementation 'com.android.support:design:27.0.2'
}


回答4:

dependencies {
    implementation 'com.android.support:design:28.0.0'
}


回答5:

You can use:

compile 'com.android.support:design:22.2.0'

I built a complete example. I hope it helps! https://github.com/erikcaffrey/AndroidDesignSupportLibrary

Remember now is available!

Android Support Library, revision 22.2.1 (July 2015)



回答6:

ctrl+alt+shift+s in the androidstudio window... project structure window will appear..
click the app in the menu bar at the left then click dependencies.. then add `com.android.support:design:26.1.0