Android--›迁移到AndroidX指南(含包依赖关系)

2023-05-16

AndroidX发布已经有段时间了, 相应的包也都出了1.0.0正式版本.

顺势而为, 才能得以生存.

是时候迁移到AndroidX了.

迁移操作本身是很简单的, 有菜单命令一键搞定.如下:
在这里插入图片描述

你以为这样就完事了?

还真是…项目妥妥的跑起来了, 还不算完事吗?

如果仅仅是为了跑起项目, 那还真的就完事了.

但是项目中的依赖包还是写的com.android.support:xxx:xxx, 所以要彻底迁移到AndroidX, 请继续往下看.

文章目录

  • 铲掉所有`com.android.support`的依赖包
  • 依赖包
    • androidx.legacy:legacy-support-v4
    • androidx.legacy:legacy-support-core-ui
    • androidx.annotation:annotation
    • androidx.core:core
    • androidx.core:core-ktx
    • androidx.appcompat:appcompat
    • androidx.fragment:fragment
    • androidx.activity:activity
    • androidx.recyclerview:recyclerview
    • androidx.cardview:cardview
    • androidx.constraintlayout:constraintlayout
    • androidx.coordinatorlayout:coordinatorlayout
    • com.google.android.material:material
    • androidx.viewpager2:viewpager2
    • androidx.localbroadcastmanager:localbroadcastmanager
    • androidx.exifinterface:exifinterface
    • androidx.test.ext:junit
    • androidx.test.espresso:espresso-core
  • 联系作者

铲掉所有com.android.support的依赖包

替换到最新的androidx对应的依赖包.

ext.androidx = [
        //com.android.support:support-v4
        "v4"                    : "androidx.legacy:legacy-support-v4:1.0.0",

        //com.android.support:exifinterface
        "exifinterface"         : "androidx.exifinterface:exifinterface:1.0.0",
        "vectordrawable"        : "androidx.vectordrawable:vectordrawable:1.1.0",

        //com.android.support:appcompat-v7
        "appcompat"             : "androidx.appcompat:appcompat:1.1.0",
        //com.android.support:support-compat
        "core"                  : "androidx.core:core:1.1.0",
        "corektx"               : "androidx.core:core-ktx:1.1.0",

        //com.android.support:support-fragment
        "fragment"              : "androidx.fragment:fragment:1.1.0",

        //com.android.support:recyclerview-v7
        "recyclerview"          : "androidx.recyclerview:recyclerview:1.0.0",

        //com.android.support:support-annotations
        "annotation"            : "androidx.annotation:annotation:1.1.0",

        //com.android.support:localbroadcastmanager
        "localbroadcastmanager" : "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0",

        //com.android.support:design
        "material"              : "com.google.android.material:material:1.0.0",

        //com.android.support:cardview-v7
        "cardview"              : "androidx.cardview:cardview:1.0.0",

        //com.android.support.constraint:constraint-layout
        "constraintlayout"      : "androidx.constraintlayout:constraintlayout:1.1.3",
        //com.android.support.constraint:constraint-layout-solver
        "constraintlayoutsolver": "androidx.constraintlayout:constraintlayout-solver:1.1.3",

        //com.android.support:coordinatorlayout
        "coordinatorlayout"     : "androidx.coordinatorlayout:coordinatorlayout:1.0.0",

        //androidx only
        "viewpager2"            : "androidx.viewpager2:viewpager2:1.0.0-beta05",
]

我这里列举了一些常用的包. 点击这里查看所有

注意 那个对应关系后的版本, 可能不是最新版本号. 最新版本号点击查看

所有包都替换完之后, 难免会出现重复的依赖包, 这个时候可以查看我的另一篇文章
AS–›Gradle 自动查找依赖版本冲突,强制指定依赖版本号,
可以强制指定版本号

有的时候, 你会发现, 一个包里面包含了另一个包, 这个时候就没必要再引入包了.

我这里列举了常用了依赖包依赖关系:

依赖包

androidx.legacy:legacy-support-v4

+--- androidx.legacy:legacy-support-v4:1.0.0
|    +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    +--- androidx.media:media:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    |    \--- androidx.versionedparcelable:versionedparcelable:1.0.0 -> 1.1.0 (*)
|    +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
|    +--- androidx.legacy:legacy-support-core-ui:1.0.0 (*)
|    \--- androidx.fragment:fragment:1.0.0 -> 1.1.0 (*)

androidx.legacy:legacy-support-core-ui

+--- androidx.legacy:legacy-support-core-ui:1.0.0
|    +--- androidx.annotation:annotation:1.0.0
|    +--- androidx.core:core:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.collection:collection:1.0.0
|    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0
|    |    |    +--- androidx.lifecycle:lifecycle-common:2.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    |    +--- androidx.arch.core:core-common:2.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    \--- androidx.versionedparcelable:versionedparcelable:1.0.0
|    |         +--- androidx.annotation:annotation:1.0.0
|    |         \--- androidx.collection:collection:1.0.0 (*)
|    +--- androidx.legacy:legacy-support-core-utils:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.core:core:1.0.0 (*)
|    |    +--- androidx.documentfile:documentfile:1.0.0
|    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.loader:loader:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0
|    |    |    +--- androidx.core:core:1.0.0 (*)
|    |    |    +--- androidx.lifecycle:lifecycle-livedata:2.0.0
|    |    |    |    +--- androidx.arch.core:core-runtime:2.0.0
|    |    |    |    |    +--- androidx.annotation:annotation:1.0.0
|    |    |    |    |    \--- androidx.arch.core:core-common:2.0.0 (*)
|    |    |    |    +--- androidx.lifecycle:lifecycle-livedata-core:2.0.0
|    |    |    |    |    +--- androidx.lifecycle:lifecycle-common:2.0.0 (*)
|    |    |    |    |    +--- androidx.arch.core:core-common:2.0.0 (*)
|    |    |    |    |    \--- androidx.arch.core:core-runtime:2.0.0 (*)
|    |    |    |    \--- androidx.arch.core:core-common:2.0.0 (*)
|    |    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0
|    |    |         \--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
|    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    \--- androidx.print:print:1.0.0
|    |         \--- androidx.annotation:annotation:1.0.0
|    +--- androidx.customview:customview:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    \--- androidx.core:core:1.0.0 (*)
|    +--- androidx.viewpager:viewpager:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.core:core:1.0.0 (*)
|    |    \--- androidx.customview:customview:1.0.0 (*)
|    +--- androidx.coordinatorlayout:coordinatorlayout:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.core:core:1.0.0 (*)
|    |    \--- androidx.customview:customview:1.0.0 (*)
|    +--- androidx.drawerlayout:drawerlayout:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.core:core:1.0.0 (*)
|    |    \--- androidx.customview:customview:1.0.0 (*)
|    +--- androidx.slidingpanelayout:slidingpanelayout:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.core:core:1.0.0 (*)
|    |    \--- androidx.customview:customview:1.0.0 (*)
|    +--- androidx.interpolator:interpolator:1.0.0
|    |    \--- androidx.annotation:annotation:1.0.0
|    +--- androidx.swiperefreshlayout:swiperefreshlayout:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.core:core:1.0.0 (*)
|    |    \--- androidx.interpolator:interpolator:1.0.0 (*)
|    +--- androidx.asynclayoutinflater:asynclayoutinflater:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    \--- androidx.core:core:1.0.0 (*)
|    \--- androidx.cursoradapter:cursoradapter:1.0.0
|         \--- androidx.annotation:annotation:1.0.0

androidx.annotation:annotation

+--- androidx.annotation:annotation:1.1.0

androidx.core:core

+--- androidx.core:core:1.1.0
|    +--- androidx.annotation:annotation:1.1.0
|    +--- androidx.lifecycle:lifecycle-runtime:2.0.0
|    |    +--- androidx.lifecycle:lifecycle-common:2.0.0
|    |    \--- androidx.arch.core:core-common:2.0.0
|    +--- androidx.versionedparcelable:versionedparcelable:1.1.0
|    |    +--- androidx.annotation:annotation:1.1.0
|    |    \--- androidx.collection:collection:1.0.0
|    |         \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    \--- androidx.collection:collection:1.0.0 (*)

androidx.core:core-ktx

+--- androidx.core:core-ktx:1.1.0
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.31 -> 1.3.50 (*)
|    +--- androidx.annotation:annotation:1.1.0
|    \--- androidx.core:core:1.1.0
|         +--- androidx.annotation:annotation:1.1.0
|         +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.1.0
|         |    +--- androidx.lifecycle:lifecycle-common:2.1.0 (*)
|         |    +--- androidx.arch.core:core-common:2.1.0
|         |    |    \--- androidx.annotation:annotation:1.1.0
|         |    \--- androidx.annotation:annotation:1.1.0
|         +--- androidx.versionedparcelable:versionedparcelable:1.1.0
|         |    +--- androidx.annotation:annotation:1.1.0
|         |    \--- androidx.collection:collection:1.0.0 -> 1.1.0
|         |         \--- androidx.annotation:annotation:1.1.0
|         \--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)

androidx.appcompat:appcompat

+--- androidx.appcompat:appcompat:1.1.0
|    +--- androidx.annotation:annotation:1.1.0
|    +--- androidx.core:core:1.1.0
|    |    +--- androidx.annotation:annotation:1.1.0
|    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.1.0
|    |    |    +--- androidx.lifecycle:lifecycle-common:2.1.0
|    |    |    |    \--- androidx.annotation:annotation:1.1.0
|    |    |    +--- androidx.arch.core:core-common:2.1.0
|    |    |    |    \--- androidx.annotation:annotation:1.1.0
|    |    |    \--- androidx.annotation:annotation:1.1.0
|    |    +--- androidx.versionedparcelable:versionedparcelable:1.1.0
|    |    |    +--- androidx.annotation:annotation:1.1.0
|    |    |    \--- androidx.collection:collection:1.0.0 -> 1.1.0
|    |    |         \--- androidx.annotation:annotation:1.1.0
|    |    \--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
|    +--- androidx.cursoradapter:cursoradapter:1.0.0
|    |    \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    +--- androidx.fragment:fragment:1.1.0
|    |    +--- androidx.annotation:annotation:1.1.0
|    |    +--- androidx.core:core:1.1.0 (*)
|    |    +--- androidx.collection:collection:1.1.0 (*)
|    |    +--- androidx.viewpager:viewpager:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    |    |    \--- androidx.customview:customview:1.0.0
|    |    |         +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |         \--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    |    +--- androidx.loader:loader:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    |    |    +--- androidx.lifecycle:lifecycle-livedata:2.0.0
|    |    |    |    +--- androidx.arch.core:core-runtime:2.0.0
|    |    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    |    \--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
|    |    |    |    +--- androidx.lifecycle:lifecycle-livedata-core:2.0.0
|    |    |    |    |    +--- androidx.lifecycle:lifecycle-common:2.0.0 -> 2.1.0 (*)
|    |    |    |    |    +--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
|    |    |    |    |    \--- androidx.arch.core:core-runtime:2.0.0 (*)
|    |    |    |    \--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
|    |    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 -> 2.1.0
|    |    |         \--- androidx.annotation:annotation:1.1.0
|    |    +--- androidx.activity:activity:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.1.0
|    |    |    +--- androidx.core:core:1.1.0 (*)
|    |    |    +--- androidx.lifecycle:lifecycle-runtime:2.1.0 (*)
|    |    |    +--- androidx.lifecycle:lifecycle-viewmodel:2.1.0 (*)
|    |    |    \--- androidx.savedstate:savedstate:1.0.0
|    |    |         +--- androidx.annotation:annotation:1.1.0
|    |    |         +--- androidx.arch.core:core-common:2.0.1 -> 2.1.0 (*)
|    |    |         \--- androidx.lifecycle:lifecycle-common:2.0.0 -> 2.1.0 (*)
|    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 -> 2.1.0 (*)
|    +--- androidx.appcompat:appcompat-resources:1.1.0
|    |    +--- androidx.annotation:annotation:1.1.0
|    |    +--- androidx.core:core:1.0.1 -> 1.1.0 (*)
|    |    +--- androidx.vectordrawable:vectordrawable:1.1.0
|    |    |    +--- androidx.annotation:annotation:1.1.0
|    |    |    +--- androidx.core:core:1.1.0 (*)
|    |    |    \--- androidx.collection:collection:1.1.0 (*)
|    |    +--- androidx.vectordrawable:vectordrawable-animated:1.1.0
|    |    |    +--- androidx.vectordrawable:vectordrawable:1.1.0 (*)
|    |    |    +--- androidx.interpolator:interpolator:1.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    \--- androidx.collection:collection:1.1.0 (*)
|    |    \--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
|    +--- androidx.drawerlayout:drawerlayout:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    |    \--- androidx.customview:customview:1.0.0 (*)
|    \--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)

androidx.fragment:fragment

+--- androidx.fragment:fragment:1.1.0
|    +--- androidx.annotation:annotation:1.1.0
|    +--- androidx.core:core:1.1.0 (*)
|    +--- androidx.collection:collection:1.1.0 (*)
|    +--- androidx.viewpager:viewpager:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    |    \--- androidx.customview:customview:1.0.0
|    |         +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |         \--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    +--- androidx.loader:loader:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    |    +--- androidx.lifecycle:lifecycle-livedata:2.0.0
|    |    |    +--- androidx.arch.core:core-runtime:2.0.0
|    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    \--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
|    |    |    +--- androidx.lifecycle:lifecycle-livedata-core:2.0.0
|    |    |    |    +--- androidx.lifecycle:lifecycle-common:2.0.0 -> 2.1.0 (*)
|    |    |    |    +--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
|    |    |    |    \--- androidx.arch.core:core-runtime:2.0.0 (*)
|    |    |    \--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
|    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 -> 2.1.0
|    |         \--- androidx.annotation:annotation:1.1.0
|    +--- androidx.activity:activity:1.0.0
|    |    +--- androidx.annotation:annotation:1.1.0
|    |    +--- androidx.core:core:1.1.0 (*)
|    |    +--- androidx.lifecycle:lifecycle-runtime:2.1.0 (*)
|    |    +--- androidx.lifecycle:lifecycle-viewmodel:2.1.0 (*)
|    |    \--- androidx.savedstate:savedstate:1.0.0
|    |         +--- androidx.annotation:annotation:1.1.0
|    |         +--- androidx.arch.core:core-common:2.0.1 -> 2.1.0 (*)
|    |         \--- androidx.lifecycle:lifecycle-common:2.0.0 -> 2.1.0 (*)
|    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 -> 2.1.0 (*)

androidx.activity:activity

+--- androidx.activity:activity:1.0.0
|    +--- androidx.annotation:annotation:1.1.0
|    +--- androidx.core:core:1.1.0
|    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.1.0
|    |    |    +--- androidx.lifecycle:lifecycle-common:2.1.0
|    |    |    |    \--- androidx.annotation:annotation:1.1.0
|    |    |    +--- androidx.arch.core:core-common:2.1.0
|    |    |    |    \--- androidx.annotation:annotation:1.1.0
|    |    |    \--- androidx.annotation:annotation:1.1.0
|    |    +--- androidx.versionedparcelable:versionedparcelable:1.1.0
|    |    |    \--- androidx.collection:collection:1.0.0
|    |    \--- androidx.collection:collection:1.0.0
|    +--- androidx.lifecycle:lifecycle-runtime:2.1.0 (*)
|    +--- androidx.lifecycle:lifecycle-viewmodel:2.1.0
|    |    \--- androidx.annotation:annotation:1.1.0
|    \--- androidx.savedstate:savedstate:1.0.0
|         +--- androidx.annotation:annotation:1.1.0
|         +--- androidx.arch.core:core-common:2.0.1 -> 2.1.0 (*)
|         \--- androidx.lifecycle:lifecycle-common:2.0.0 -> 2.1.0 (*)

androidx.recyclerview:recyclerview

+--- androidx.recyclerview:recyclerview:1.0.0
|    +--- androidx.annotation:annotation:1.0.0
|    +--- androidx.core:core:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.collection:collection:1.0.0
|    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0
|    |    |    +--- androidx.lifecycle:lifecycle-common:2.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    |    +--- androidx.arch.core:core-common:2.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    \--- androidx.versionedparcelable:versionedparcelable:1.0.0
|    |         +--- androidx.annotation:annotation:1.0.0
|    |         \--- androidx.collection:collection:1.0.0 (*)
|    \--- androidx.legacy:legacy-support-core-ui:1.0.0
|         +--- androidx.annotation:annotation:1.0.0
|         +--- androidx.core:core:1.0.0 (*)
|         +--- androidx.legacy:legacy-support-core-utils:1.0.0
|         |    +--- androidx.annotation:annotation:1.0.0
|         |    +--- androidx.core:core:1.0.0 (*)
|         |    +--- androidx.documentfile:documentfile:1.0.0
|         |    |    \--- androidx.annotation:annotation:1.0.0
|         |    +--- androidx.loader:loader:1.0.0
|         |    |    +--- androidx.annotation:annotation:1.0.0
|         |    |    +--- androidx.core:core:1.0.0 (*)
|         |    |    +--- androidx.lifecycle:lifecycle-livedata:2.0.0
|         |    |    |    +--- androidx.arch.core:core-runtime:2.0.0
|         |    |    |    |    +--- androidx.annotation:annotation:1.0.0
|         |    |    |    |    \--- androidx.arch.core:core-common:2.0.0 (*)
|         |    |    |    +--- androidx.lifecycle:lifecycle-livedata-core:2.0.0
|         |    |    |    |    +--- androidx.lifecycle:lifecycle-common:2.0.0 (*)
|         |    |    |    |    +--- androidx.arch.core:core-common:2.0.0 (*)
|         |    |    |    |    \--- androidx.arch.core:core-runtime:2.0.0 (*)
|         |    |    |    \--- androidx.arch.core:core-common:2.0.0 (*)
|         |    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0
|         |    |         \--- androidx.annotation:annotation:1.0.0
|         |    +--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
|         |    |    \--- androidx.annotation:annotation:1.0.0
|         |    \--- androidx.print:print:1.0.0
|         |         \--- androidx.annotation:annotation:1.0.0
|         +--- androidx.customview:customview:1.0.0
|         |    +--- androidx.annotation:annotation:1.0.0
|         |    \--- androidx.core:core:1.0.0 (*)
|         +--- androidx.viewpager:viewpager:1.0.0
|         |    +--- androidx.annotation:annotation:1.0.0
|         |    +--- androidx.core:core:1.0.0 (*)
|         |    \--- androidx.customview:customview:1.0.0 (*)
|         +--- androidx.coordinatorlayout:coordinatorlayout:1.0.0
|         |    +--- androidx.annotation:annotation:1.0.0
|         |    +--- androidx.core:core:1.0.0 (*)
|         |    \--- androidx.customview:customview:1.0.0 (*)
|         +--- androidx.drawerlayout:drawerlayout:1.0.0
|         |    +--- androidx.annotation:annotation:1.0.0
|         |    +--- androidx.core:core:1.0.0 (*)
|         |    \--- androidx.customview:customview:1.0.0 (*)
|         +--- androidx.slidingpanelayout:slidingpanelayout:1.0.0
|         |    +--- androidx.annotation:annotation:1.0.0
|         |    +--- androidx.core:core:1.0.0 (*)
|         |    \--- androidx.customview:customview:1.0.0 (*)
|         +--- androidx.interpolator:interpolator:1.0.0
|         |    \--- androidx.annotation:annotation:1.0.0
|         +--- androidx.swiperefreshlayout:swiperefreshlayout:1.0.0
|         |    +--- androidx.annotation:annotation:1.0.0
|         |    +--- androidx.core:core:1.0.0 (*)
|         |    \--- androidx.interpolator:interpolator:1.0.0 (*)
|         +--- androidx.asynclayoutinflater:asynclayoutinflater:1.0.0
|         |    +--- androidx.annotation:annotation:1.0.0
|         |    \--- androidx.core:core:1.0.0 (*)
|         \--- androidx.cursoradapter:cursoradapter:1.0.0
|              \--- androidx.annotation:annotation:1.0.0

androidx.cardview:cardview

+--- androidx.cardview:cardview:1.0.0 (*)
\--- androidx.annotation:annotation:1.0.0 -> 1.1.0

androidx.constraintlayout:constraintlayout

+--- androidx.constraintlayout:constraintlayout:1.1.3
|    \--- androidx.constraintlayout:constraintlayout-solver:1.1.3

androidx.coordinatorlayout:coordinatorlayout

+--- androidx.coordinatorlayout:coordinatorlayout:1.0.0
|    +--- androidx.annotation:annotation:1.0.0
|    +--- androidx.core:core:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.collection:collection:1.0.0
|    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0
|    |    |    +--- androidx.lifecycle:lifecycle-common:2.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    |    +--- androidx.arch.core:core-common:2.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    \--- androidx.versionedparcelable:versionedparcelable:1.0.0
|    |         +--- androidx.annotation:annotation:1.0.0
|    |         \--- androidx.collection:collection:1.0.0 (*)
|    \--- androidx.customview:customview:1.0.0
|         +--- androidx.annotation:annotation:1.0.0
|         \--- androidx.core:core:1.0.0 (*)

com.google.android.material:material

+--- com.google.android.material:material:1.0.0
|    +--- androidx.annotation:annotation:1.0.0
|    +--- androidx.core:core:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.collection:collection:1.0.0
|    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0
|    |    |    +--- androidx.lifecycle:lifecycle-common:2.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    |    +--- androidx.arch.core:core-common:2.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    \--- androidx.versionedparcelable:versionedparcelable:1.0.0
|    |         +--- androidx.annotation:annotation:1.0.0
|    |         \--- androidx.collection:collection:1.0.0 (*)
|    +--- androidx.legacy:legacy-support-core-ui:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.core:core:1.0.0 (*)
|    |    +--- androidx.legacy:legacy-support-core-utils:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0
|    |    |    +--- androidx.core:core:1.0.0 (*)
|    |    |    +--- androidx.documentfile:documentfile:1.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    |    +--- androidx.loader:loader:1.0.0
|    |    |    |    +--- androidx.annotation:annotation:1.0.0
|    |    |    |    +--- androidx.core:core:1.0.0 (*)
|    |    |    |    +--- androidx.lifecycle:lifecycle-livedata:2.0.0
|    |    |    |    |    +--- androidx.arch.core:core-runtime:2.0.0
|    |    |    |    |    |    +--- androidx.annotation:annotation:1.0.0
|    |    |    |    |    |    \--- androidx.arch.core:core-common:2.0.0 (*)
|    |    |    |    |    +--- androidx.lifecycle:lifecycle-livedata-core:2.0.0
|    |    |    |    |    |    +--- androidx.lifecycle:lifecycle-common:2.0.0 (*)
|    |    |    |    |    |    +--- androidx.arch.core:core-common:2.0.0 (*)
|    |    |    |    |    |    \--- androidx.arch.core:core-runtime:2.0.0 (*)
|    |    |    |    |    \--- androidx.arch.core:core-common:2.0.0 (*)
|    |    |    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0
|    |    |    |         \--- androidx.annotation:annotation:1.0.0
|    |    |    +--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    |    \--- androidx.print:print:1.0.0
|    |    |         \--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.customview:customview:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0
|    |    |    \--- androidx.core:core:1.0.0 (*)
|    |    +--- androidx.viewpager:viewpager:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0
|    |    |    +--- androidx.core:core:1.0.0 (*)
|    |    |    \--- androidx.customview:customview:1.0.0 (*)
|    |    +--- androidx.coordinatorlayout:coordinatorlayout:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0
|    |    |    +--- androidx.core:core:1.0.0 (*)
|    |    |    \--- androidx.customview:customview:1.0.0 (*)
|    |    +--- androidx.drawerlayout:drawerlayout:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0
|    |    |    +--- androidx.core:core:1.0.0 (*)
|    |    |    \--- androidx.customview:customview:1.0.0 (*)
|    |    +--- androidx.slidingpanelayout:slidingpanelayout:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0
|    |    |    +--- androidx.core:core:1.0.0 (*)
|    |    |    \--- androidx.customview:customview:1.0.0 (*)
|    |    +--- androidx.interpolator:interpolator:1.0.0
|    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.swiperefreshlayout:swiperefreshlayout:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0
|    |    |    +--- androidx.core:core:1.0.0 (*)
|    |    |    \--- androidx.interpolator:interpolator:1.0.0 (*)
|    |    +--- androidx.asynclayoutinflater:asynclayoutinflater:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0
|    |    |    \--- androidx.core:core:1.0.0 (*)
|    |    \--- androidx.cursoradapter:cursoradapter:1.0.0
|    |         \--- androidx.annotation:annotation:1.0.0
|    +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
|    +--- androidx.fragment:fragment:1.0.0
|    |    +--- androidx.core:core:1.0.0 (*)
|    |    +--- androidx.legacy:legacy-support-core-ui:1.0.0 (*)
|    |    +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.loader:loader:1.0.0 (*)
|    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 (*)
|    +--- androidx.transition:transition:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    \--- androidx.core:core:1.0.0 (*)
|    +--- androidx.appcompat:appcompat:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.core:core:1.0.0 (*)
|    |    +--- androidx.collection:collection:1.0.0 (*)
|    |    +--- androidx.cursoradapter:cursoradapter:1.0.0 (*)
|    |    +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
|    |    +--- androidx.fragment:fragment:1.0.0 (*)
|    |    +--- androidx.vectordrawable:vectordrawable:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0
|    |    |    \--- androidx.core:core:1.0.0 (*)
|    |    \--- androidx.vectordrawable:vectordrawable-animated:1.0.0
|    |         +--- androidx.vectordrawable:vectordrawable:1.0.0 (*)
|    |         \--- androidx.legacy:legacy-support-core-ui:1.0.0 (*)
|    +--- androidx.cardview:cardview:1.0.0
|    |    \--- androidx.annotation:annotation:1.0.0
|    \--- androidx.recyclerview:recyclerview:1.0.0
|         +--- androidx.annotation:annotation:1.0.0
|         +--- androidx.core:core:1.0.0 (*)
|         \--- androidx.legacy:legacy-support-core-ui:1.0.0 (*)

androidx.viewpager2:viewpager2

+--- androidx.viewpager2:viewpager2:1.0.0-beta05
|    +--- androidx.annotation:annotation:1.1.0
|    +--- androidx.fragment:fragment:1.1.0 (*)
|    +--- androidx.recyclerview:recyclerview:1.1.0-beta05 (*)
|    +--- androidx.core:core:1.1.0 (*)
|    \--- androidx.collection:collection:1.1.0 (*)

androidx.localbroadcastmanager:localbroadcastmanager

+--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 (*)

androidx.exifinterface:exifinterface

+--- androidx.exifinterface:exifinterface:1.0.0
|    \--- androidx.annotation:annotation:1.0.0 -> 1.1.0

androidx.test.ext:junit

+--- androidx.test.ext:junit:1.1.1
|    +--- junit:junit:4.12
|    |    \--- org.hamcrest:hamcrest-core:1.3
|    +--- androidx.test:core:1.2.0
|    |    +--- androidx.annotation:annotation:1.0.0
|    |    +--- androidx.test:monitor:1.2.0
|    |    |    \--- androidx.annotation:annotation:1.0.0
|    |    \--- androidx.lifecycle:lifecycle-common:2.0.0
|    |         \--- androidx.annotation:annotation:1.0.0
|    +--- androidx.test:monitor:1.2.0 (*)
|    \--- androidx.annotation:annotation:1.0.0

androidx.test.espresso:espresso-core

\--- androidx.test.espresso:espresso-core:3.2.0
     +--- androidx.test:runner:1.2.0
     |    +--- androidx.annotation:annotation:1.0.0
     |    +--- androidx.test:monitor:1.2.0 (*)
     |    +--- junit:junit:4.12 (*)
     |    \--- net.sf.kxml:kxml2:2.3.0
     +--- androidx.test.espresso:espresso-idling-resource:3.2.0
     +--- com.squareup:javawriter:2.1.1
     +--- javax.inject:javax.inject:1
     +--- org.hamcrest:hamcrest-library:1.3
     |    \--- org.hamcrest:hamcrest-core:1.3
     +--- org.hamcrest:hamcrest-integration:1.3
     |    \--- org.hamcrest:hamcrest-library:1.3 (*)
     \--- com.google.code.findbugs:jsr305:2.0.1

从上面可以看出
androidx.appcompat:appcompat:1.1.0这个包, 基本上包含了常用的库, 所以大家默认导入这一个库即可, 其他的库按需加载就行.
com.google.android.material:material:1.0.0这个包, 包含了常用的库常用的UI库, 导入这一个, 啥都有了.

更多的依赖关系, 可以执行命令 gradlew app:dependencies 查看.


群内有各(pian)种(ni)各(jin)样(qun)的大佬,等你来撩.

联系作者

点此QQ对话 该死的空格 点此快速加群

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android--›迁移到AndroidX指南(含包依赖关系) 的相关文章

  • 开源免费的手机版 LoRa App,演示和调试 LoRaWAN 数据的神器

    继 可配置数据解析格式的 LoRaAppDemo 64 C 应用工具 的PC工具之后 xff0c 为了帮助 LoRa 用户 演示数据和调试开发 xff0c 开源 xff0c 免费 xff0c 可安装在Android 手机的移动端App 一
  • 开源免费的 LoRa App 设计原理和组件

    为了帮助 LoRa 用户演示数据和调试开发 xff0c 开源免费的 LoRa App 推出后深受好评 下载与使用请链接 开源免费的手机版 LoRa App xff0c 演示和调试 LoRaWAN 数据的神器 https blog csdn
  • 如何测试 LoRaWAN 全球频段

    To be a sailor of the world bound for all ports 做世界的水手 xff0c 游遍所有的港口 背景 自 2015 年 LoRa 联盟创建 LoRaWAN 协议 xff0c 经过 7 年长跑 xff
  • LoRa Server@Ubuntu#2:一键安装

    LoRa Server 64 Ubuntu 2 xff1a 一键安装 LoRa Server 是一个开源的 LoRaWAN 网络服务器 xff0c 它具备很多优点 xff1a 工程性 xff0c 模块化 xff0c 功能实现 xff0c 维
  • 【转帖】VxWork介绍及编程

    VxWork介绍及编程 一 嵌入式操作系统VxWorks简介 VxWorks操作系统是美国WindRiver公司于1983年设计开发的一种嵌入式实时操作系统 xff08 RTOS xff09 xff0c 是嵌入式开发环境的关键组成部分 良好
  • 文件恢复

    对于广大电脑爱好者来说 xff0c 最担心的事莫过于数据损坏 xff08 丢失 xff09 了 xff0c 如果只是系统崩溃 xff0c 那么我们还可以重新安装 xff0c 所花费的只是时间而已 即使是硬件损坏 xff0c 也只是需要更换新
  • Kotlin--›Android RecyclerView滚动处理(滚动到底部/顶部/居中/偏移/动画等特性)

    之前写过一篇Android gt RecyclerView 显示底部 滚动底部 无动画 文章 当时是为了满足需求 没想太多顺手写的 虽然功能上能满足 但是代码上还是有点low 这几天 我的徒弟傻豆 在写一个IM项目 需要滚动到底部 于是我重
  • 数据恢复全解析

    原创 数据恢复全解析 文档提交 ionwing 提交时间 2005 7 1 11 00 44 原创作者 离子翼 离子翼信息安全实验室 http www ionwing com 当今的世界已经完全步入了信息时代 xff0c 在我们每天的生活当
  • 轻松打造xfce4轻快桌面

    我是这么作的 cd usr X11R6 etc xfce4 cp menu xml zh CN menu xml 右键菜单就是中文的了 可是我改了任何一个部分 xff0c 菜单就只剩一个点了 哪位大虾来指点指点 我将 LANG LC CTY
  • compress函数与uncompress函数

    compress函数与uncompress函数 zlib 是通用的压缩库 xff0c 提供了一套 in memory 压缩和解压函数 xff0c 并能检测解压出来的数据的完整性 integrity zlib 也支持读写 gzip gz 格式
  • 获取股票实时交易数据的方法

    获取股票实时交易数据的方法 注 xff1a 本文为原创文章 xff0c 转载时请注明转载地址 炒股有一段时间了 xff0c 发现现在的股票行情软件在很多情况下并不是太好用 xff0c 我炒股的时候喜欢看盘口的实时交易记录 xff0c 如果同
  • linux和windows下,C/C++的sleep函数

    简介 函数名 sleep 功 能 执行挂起一段时间 用 法 unsigned sleep unsigned seconds 在VC中使用带上头文件 include lt windows h gt 在gcc 编译器 中 xff0c 使用的头文
  • Linux下undefined reference to ‘pthread_create’问题解决

    接触了Linux系统编程中的线程编程模块 xff0c 可gcc sample c xff08 习惯把书上的sample代码写进sample c文件中 xff09 出现 undefined reference to pthread creat
  • Java的文件读写操作

    file 内存 输入流 gt 程序 输出流 gt file 内存 当我们读写文本文件的时候 xff0c 采用Reader是非常方便的 xff0c 比如FileReader xff0c InputStreamReader和BufferedRe
  • 颜色空间RGB与HSV(HSL)的转换

    一般的3D编程只需要使用RGB颜色空间就好了 xff0c 但其实美术人员更多的是使用HSV HSL xff0c 因为可以方便的调整饱和度和亮度 有时候美术需要程序帮助调整饱和度来达到特定风格的渲染效果 xff0c 这时候就需要转换颜色空间了
  • 使用DatagramSocket发送、接收数据(Socket之UDP套接字)

    http book 51cto com art 201203 322540 htm 17 4 2 使用DatagramSocket发送 接收数据 xff08 1 xff09 Java使用DatagramSocket代表UDP协议的Socke
  • Ubuntu中root用户和user用户的相互切换

    Ubuntu中root用户和user用户的相互切换 Ubuntu是最近很流行的一款Linux系统 xff0c 因为Ubuntu默认是不启动root用户 xff0c 现在介绍如何进入root的方法 xff08 1 xff09 从user用户切
  • AS--›Gradle 自动查找依赖版本冲突,强制指定依赖版本号

    一个工程 依赖的第三方包越来越多的时候 肯定是会出现多个包同时引入了同一个库的不同版本 如果不出问题 大部分同学应该不会注意到版本冲突的问题 但是本着对代码负责的原则 我们还是需要主动解决的 手动打印依赖信息 gradlew app spa
  • virtualbox虚拟机使用笔记-安装、增强功能、网络、usb设备、共享目录

    virtualbox虚拟机使用笔记 xff0d 安装 增强功能 网络 usb设备 共享目录 摘要 xff1a virtualbox虚拟机的安装 增强功能 网络 usb设备 共享目录 主系统 xff1a ubuntu8 10 虚拟系统 xff
  • 为WPF和Silverlight的Grid添加边框线

    为WPF和Silverlight的Grid添加边框线 原文链接 在此源代码的基础上 经过简单修改 保证了边框线条宽度统一 修改后的源代码 using System Windows using System Windows Controls

随机推荐

  • 腾讯加入QQ群 连接代码

    lt a href 61 34 http qun qq com jointhegroup gid 112083409 34 target 61 34 blank 34 gt lt img title 61 34 java技术研究QQ群 34
  • c/c++常用资源 c/c++书籍下载

    c c 43 43 常用资源 aix在线文档 xff1a http publib16 boulder ibm com cgi bin ds rslt 1 各种c c 43 43 编译器 http www clipx net norton p
  • &和&&区别,有谁可以详细的讲一下谢谢!

    amp 和 amp amp 区别 xff0c 有谁可以详细的讲一下谢谢 xff01
  • Centos下安装oracle jdk

    Centos下安装oracle jdk 安装jdk环境就那么几步 xff1a 下载jdk 解压缩 设置环境变量 其中设置环境变量又包括 配置java home配置class path配置系统path 非要说麻烦的话 xff0c 最麻烦的就是
  • 【Spring】Spring MVC原理及配置详解

    Spring Spring MVC原理及配置 1 Spring MVC概述 xff1a Spring MVC是Spring提供的一个强大而灵活的web框架 借助于注解 xff0c Spring MVC提供了几乎是POJO的开发模式 xff0
  • JAVA项目接入腾讯应用宝YSDK平台之QQ微信登录接入模式详解

    前言 腾讯应用宝QQ 微信登陆功能的接入相当简单 xff0c 客户端要做的操作让你们的前端人员来负责 我们JAVA后端要做的只是 34 将前端登录后得到的返回消息 在发送给ysdk平台 进行一下二次验证 看客户端登录的是否有效即可 34 弄
  • JAVA项目接入腾讯应用宝YSDK平台之道具直购支付模式接入详解

    前言 道具直购模式 简单的说就是Q币 人民币 兑换游戏中的货币 可以先看下官网介绍 nbsp 在看下面这篇博客 nbsp 这时 你就应该理解掌握了80 nbsp 最后关键的20 nbsp 再看我下面的介绍 nbsp 就可以完美的接入成功 官
  • 由于mariadb不支持json操作符->>,只得卸载mariadb,并安装mysql

    1 玛莉亚 xff08 maria xff09 不喜欢 gt gt 今天我的一个基于mysql的程序 xff0c 在mariadb上跑 xff0c 结果报错了 xff0c 查了一下 xff0c 原来是不支持如下sql xff1a SELEC
  • Kotlin--›Kotlin时代的Adapter(Android 一个话时代的DslAdapter(多类型,情感图,加载更多,多选,群组等))

    DslAdapter Kotlin时代的Adapter Dsl 的形式使用 RecyclerView Adapter 支持情感图状态切换 加载更多 多类型Item等 有何用 只有一个目的高效开发 一切都是为了效率 可能以前写界面 还在为了继
  • PageRank算法 到 textRank

    1 PageRank 算法概述 PageRank 即网页排名 xff0c 又称网页级别 Google 左侧排名或佩奇排名 是Google创始人拉里 佩奇和谢尔盖 布林于1997年构建早期的搜索系统原型时提出的链接分析算法 xff0c 自从G
  • 2015年阿里实习生面试总结

    2015年阿里实习生招聘总结 就在这学期作为大三的我 xff0c 本想在这个学期安安静静的学习 xff0c 9月份再参加招聘 xff0c 偶然在朋友那里听到了阿里实习生招聘的消息 xff0c 我还是挺喜欢阿里这个公司的 xff0c 氛围好
  • 揭秘Socket与底层数据传输实现

    揭秘socket 什么是socket xff1f socket字面意思其实就是一个插口或者套接字 xff0c 包含了源ip地址 源端口 目的ip地址和源端口 但是socket在那个位置呢 xff0c 在TCP IP网络的四层体系和OSI七层
  • tomcat的启动过程(Tomcat源码解析(三))

    Tomcat组件生命周期管理 在 Tomcat总体结构 xff08 Tomcat源代码解析之二 xff09 中 xff0c 我们列出了Tomcat中Server Service Connector Engine Host Context的继
  • Tomcat请求处理过程(Tomcat源码解析五)

    前面已经分析完了Tomcat的启动和关闭过程 xff0c 本篇就来接着分析一下Tomcat中请求的处理过程 在开始本文之前 xff0c 咋们首先来看看一个Http请求处理的过程 xff0c 一般情况下是浏览器发送http请求 gt 建立So
  • Tomcat 设计模式总结(Tomcat源代码阅读系列之八)

    本篇我们将来分析一下Tomcat中所涉及到设计模式 xff0c 本文我们将主要来分析 外观模式 xff0c 观察者模式 xff0c 责任链模式 xff0c 模板方法模式 命令模式 在开始本文之前 xff0c 笔者先说明一下对于设计模式的一点
  • TCP三次握手及关闭时的2MSL分析

    TCP IP三次握手四次挥手 xff0c 是非常重要的 xff0c 这个链接与关闭过程也是很简单的 xff0c 但为什么是三次握手 xff1f 以及为什么要等待2MSL的状态 xff1f 大部分人也许听到这个问题就蒙了 xff0c 这篇博客
  • HashTable源码剖析

    lt span style 61 34 font size 14px font weight normal 34 gt public class Hashtable lt K V gt extends Dictionary lt K V g
  • HashMap源码剖析

    大部分思路都是一样的 xff0c 只是一些细节不一样 xff0c 源码中都标了出来 jdk容器源码还是挺简单的 public class HashMap lt K V gt extends AbstractMap lt K V gt imp
  • Android设置/配置页面,androidx.preference的使用

    一场与Preference的战争 一 介绍二 简单使用以下将会通过简单的Demo实现Preference的样例引入build gradleMainActivity javaactivity main xmlSettingFragment j
  • Android--›迁移到AndroidX指南(含包依赖关系)

    AndroidX发布已经有段时间了 相应的包也都出了1 0 0正式版本 顺势而为 才能得以生存 是时候迁移到AndroidX了 迁移操作本身是很简单的 有菜单命令一键搞定 如下 你以为这样就完事了 还真是 项目妥妥的跑起来了 还不算完事吗