Vikas Acharya
Vikas Acharya

Reputation: 4152

cannot implement support design library in build gradle file

I'm trying to use Coordinator Layout in my xml file and found that it's corresponding libraries doesn't exists.

So i tried to include this in my gradle build file

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

but it's giving the error

Supplied String module notation 'androidx.' is invalid. Example notations: > 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core:1.9.5:javadoc'.

Then i found all support libraries is deprecated and one need to use androidx library.

How to include this library in my gradle file ? ***My main intention is to use Coordinator Layout in my UI

Upvotes: 1

Views: 395

Answers (2)

Rameswar Tarai
Rameswar Tarai

Reputation: 109

Click on "Refactor" on the android studio menu bar. Select "Migrate to Androidx..."

Job Done.

Upvotes: 1

Vivek Vinodh
Vivek Vinodh

Reputation: 114

You are correct in saying that the support libraries have been deprecated. The new standard is AndroidX. Here is a link that shows the current mappings from the old support libraries to AndroidX.

Specifically for CoordinatorLayout, it has gone from com.android.support:coordinatorlayout to androidx.coordinatorlayout:coordinatorlayout

Furthermore, I suggest reading this page about migrating to AndroidX. It offers a lot of information and will make your transition to AndroidX much smoother.

Upvotes: 0

Related Questions