What replaced appcompat-v7 in AndroidX

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 07:48:40

问题


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?


回答1:


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



回答2:


See Migration guide, Maven artifact mappings, your artifacts are listed there.




回答3:


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



来源:https://stackoverflow.com/questions/57655435/what-replaced-appcompat-v7-in-androidx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!