Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What replaced appcompat-v7 in AndroidX

After migrating a couple of my older projects over to AndroidX it as though three of my dependencies are deprecated:

   implementation 'com.android.support:appcompat-v7:28.0.0'
   implementation 'com.android.support:design:28.0.0'
   implementation 'com.android.support:cardview-v7:28.0.0'

I haven't been able to find a replacement for these dependencies.

Does AndroidX have an equivalent for these dependencies?

like image 294
CupOfJava Avatar asked Aug 26 '19 09:08

CupOfJava


People also ask

What is Appcompat and AndroidX?

Official Description: The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later.

What is new in AndroidX?

androidx packages fully replace the Support Library by providing feature parity and new libraries. In addition, AndroidX includes the following features: All packages in AndroidX live in a consistent namespace starting with the string androidx . The Support Library packages have been mapped into corresponding androidx.

What is difference between v4 and v7 in Android?

there is no diffrence between v4 support and v7 support.


3 Answers

Use in the order:

implementation 'androidx.appcompat:appcompat:1.0.2'   
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'

If you would like to use alpha/beta releases:

implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'com.google.android.material:material:1.1.0-alpha09'

More info about the releases:

  • AndroidX Releases
  • Material Components library
like image 157
Gabriele Mariotti Avatar answered Oct 24 '22 03:10

Gabriele Mariotti


Yes, AndroidX has new Dependencies.

Use below implementation in your project

implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.cardview:cardview:1.0.0'

Instead of

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'

and for more refer below link :-

  • https://developer.android.com/jetpack/androidx/migrate/artifact-mappings

and make sure before migrating the project to androidX.

Steps to migrate Project (Very Easy)

1 : add gradle.properties file if doesn't exits. and add below line

org.gradle.jvmargs=-Xmx1536M

2 : goto refactor > Migrate to Android X

and do not change anything studio will automatically update all things

like image 28
Bhaven Shah Avatar answered Oct 24 '22 02:10

Bhaven Shah


New Android Design Libraries with androidx:

AppCompat:

implementation 'androidx.appcompat:appcompat:1.2.0'

CardViex:

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'

Material:

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

Recyclerview:

implementation 'androidx.recyclerview:recyclerview:1.2.0'
like image 28
DevPolarBear Avatar answered Oct 24 '22 03:10

DevPolarBear