Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import new Android Design Support library

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

like image 208
ouya Avatar asked May 30 '15 06:05

ouya


People also ask

What is Android Design Support library?

The Design Support library adds support for various material design components and patterns for app developers to build upon, such as navigation drawers, floating action buttons (FAB), snackbars, and tabs.

How do I add the v7 Appcompat support library to my project?

In the Properties window, select the "Android" properties group at left and locate the Library properties at right. Select /path/to/appcompat/ and Click Remove. Click Add to open the Project Selection dialog. From the list of available library projects, select v7 appcompat library and click OK.

How do I update my Android library?

Update the Android Support LibraryIn Android Studio, click the SDK Manager icon from the menu bar, launch standalone SDK Manager, select Android Support Repository and click “Install x packages” to update it. Note you will see both Android Support Repository and Android Support Library listed in the SDK Manager.


3 Answers

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.

like image 172
Gabriele Mariotti Avatar answered Oct 22 '22 01:10

Gabriele Mariotti


dependencies {
    implementation 'com.android.support:design:28.0.0'
}
like image 31
Rusahang Limbu Avatar answered Oct 22 '22 01:10

Rusahang Limbu


New Android Design Libraries usually start with androidx word, such as:

AppCompat androidx:

implementation 'androidx.appcompat:appcompat:1.2.0'

CardViex androidx:

implementation 'androidx.cardview:cardview:1.0.0'

However be careful because everything is not start with androidx. For example, old design dependency is:

implementation 'com.android.support:design:28.0.0'

But new design dependency is:

implementation 'com.google.android.material:material:1.1.0'

Recyclerview dependency is:

implementation 'androidx.recyclerview:recyclerview:1.2.0'

So, you have to search and read carefully.

like image 4
DevPolarBear Avatar answered Oct 22 '22 01:10

DevPolarBear