1,配置文件两行去掉
2,1个开源框架不升级
3,anko框架需要用common包
4,gradle升级
AndroidX与Android Support包不兼容问题的解决方式
support转androidx关系映射
AndroidX终极迁移指南
step1 升级版本
将compileSdkVersion调整为28,将项目的support库版本升级到28.0.0。
因为androidx 1.0.0版本和support库的28.0.0版本在二级制层面是等效的,也就是说这两个版本的差异之处仅限于代码包名称,一切的API都是相同的。这样你就只需要做最少的事情来解决28.0.0到androidx之前的迁移问题。
step2 开启Jetifier
在项目的gradle.properties文件内添加如下代码
android.useAndroidX=true
android.enableJetifier=true
useAndroidX=ture
android 插件会使用对应的 AndroidX 库(而非支持库)。
enableJetifier=ture
Android 插件会通过重写其二进制文件来自动迁移现有的第三方库以使用 AndroidX。
Jetifier绝对不会改变你的源码还有你生成的代码。
step3 更新依赖
将app依赖的三方库尽量都升级到支持androidx的版本,这样可以避免在迁移中发生冲突。
注意:如果你使用了kotlin,请将annotationProcessor替换为kapt
最新依赖
a,
"glide": "com.github.bumptech.glide:glide:4.12.0",
"glide-compiler": "com.github.bumptech.glide:compiler:4.12.0",
implementation 'com.tencent.bugly:crashreport:3.3.9'
b,
glide Change
bugly Change
multidex
gson Change
okhttp3 noChange
universal-image-loader noChange
logger Change
simplifyspan Change
JDAddressSelector noChange
FlycoRoundView noChange
SmartRefreshLayout Change
BaseRecyclerViewAdapterHelper Change
jdPaySDK_Android_JDMall_JDJR arr noChange
alipaySdk arr noChange
videocache
AndroidVideoCache Change
ijkplayer noChange
banner
AndroidX升级踩坑
gradle中配置android.useAndroidX与android.enableJetifier使应用对support库的依赖自动转换为androidx的依赖
android.support升级到androidx踩坑记录
androidx.arch.core:core-common:2.0.0-rc01
androidx.arch.core:core:2.0.0-rc01
androidx.arch.core:core-testing:2.0.0-rc01
androidx.arch.core:core-runtime:2.0.0-rc01
androidx.lifecycle:lifecycle-common:2.0.0-rc01
androidx.lifecycle:lifecycle-common-java8:2.0.0-rc01
androidx.lifecycle:lifecycle-compiler:2.0.0-rc01
androidx.lifecycle:lifecycle-extensions:2.0.0-rc01
androidx.lifecycle:lifecycle-livedata:2.0.0-rc01
androidx.lifecycle:lifecycle-livedata-core:2.0.0-rc01
androidx.lifecycle:lifecycle-reactivestreams:2.0.0-rc01
androidx.lifecycle:lifecycle-runtime:2.0.0-rc01
androidx.lifecycle:lifecycle-viewmodel:2.0.0-rc01
androidx.paging:paging-common:2.0.0-rc01
androidx.paging:paging-runtime:2.0.0-rc01
androidx.paging:paging-rxjava2:2.0.0-rc01
androidx.room:room-common:2.0.0-rc01
androidx.room:room-compiler:2.0.0-rc01
androidx.room:room-guava:2.0.0-rc01
androidx.room:room-migration:2.0.0-rc01
androidx.room:room-runtime:2.0.0-rc01
androidx.room:room-rxjava2:2.0.0-rc01
androidx.room:room-testing:2.0.0-rc01
androidx.sqlite:sqlite:2.0.0-rc01
androidx.sqlite:sqlite-framework:2.0.0-rc01
androidx.constraintlayout:constraintlayout:1.1.2
androidx.constraintlayout:constraintlayout-solver:1.1.2
androidx.vectordrawable:vectordrawable-animated:1.0.0
androidx.appcompat:appcompat:1.0.0
androidx.asynclayoutinflater:asynclayoutinflater:1.0.0
androidx.car:car:1.0.0-alpha5
androidx.cardview:cardview:1.0.0
androidx.collection:collection:1.0.0
androidx.coordinatorlayout:coordinatorlayout:1.0.0
androidx.cursoradapter:cursoradapter:1.0.0
androidx.browser:browser:1.0.0
androidx.customview:customview:1.0.0
com.google.android.material:material:1.0.0-rc01
androidx.documentfile:documentfile:1.0.0
androidx.drawerlayout:drawerlayout:1.0.0
androidx.exifinterface:exifinterface:1.0.0
androidx.gridlayout:gridlayout:1.0.0
androidx.heifwriter:heifwriter:1.0.0
androidx.interpolator:interpolator:1.0.0
androidx.leanback:leanback:1.0.0
androidx.loader:loader:1.0.0
androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
androidx.media2:media2:1.0.0-alpha03
androidx.media2:media2-exoplayer:1.0.0-alpha01
androidx.mediarouter:mediarouter:1.0.0
androidx.multidex:multidex:2.0.0
androidx.multidex:multidex-instrumentation:2.0.0
androidx.palette:palette:1.0.0
androidx.percentlayout:percentlayout:1.0.0
androidx.leanback:leanback-preference:1.0.0
androidx.legacy:legacy-preference-v14:1.0.0
androidx.preference:preference:1.0.0
androidx.print:print:1.0.0
androidx.recommendation:recommendation:1.0.0
androidx.recyclerview:recyclerview-selection:1.0.0
androidx.recyclerview:recyclerview:1.0.0
androidx.slice:slice-builders:1.0.0
androidx.slice:slice-core:1.0.0
androidx.slice:slice-view:1.0.0
androidx.slidingpanelayout:slidingpanelayout:1.0.0
androidx.annotation:annotation:1.0.0
androidx.core:core:1.0.0
androidx.contentpager:contentpager:1.0.0
androidx.legacy:legacy-support-core-ui:1.0.0
androidx.legacy:legacy-support-core-utils:1.0.0
androidx.dynamicanimation:dynamicanimation:1.0.0
androidx.emoji:emoji:1.0.0
androidx.emoji:emoji-appcompat:1.0.0
androidx.emoji:emoji-bundled:1.0.0
androidx.fragment:fragment:1.0.0
androidx.media:media:1.0.0
androidx.tvprovider:tvprovider:1.0.0
androidx.legacy:legacy-support-v13:1.0.0
androidx.legacy:legacy-support-v4:1.0.0
androidx.vectordrawable:vectordrawable:1.0.0
androidx.swiperefreshlayout:swiperefreshlayout:1.0.0
androidx.textclassifier:textclassifier:1.0.0
androidx.transition:transition:1.0.0
androidx.versionedparcelable:versionedparcelable:1.0.0
androidx.viewpager:viewpager:1.0.0
androidx.wear:wear:1.0.0
androidx.webkit:webkit:1.0.0
Android Studio查看第三方库依赖树
Android 将support组件化项目迁移到Androidx方案
AndroidX终极迁移指南
将app依赖的三方库尽量都升级到支持androidx的版本
AndroidX终极迁移指南
Android AndroidX迁移库
迁移AndroidX
是时候迁移至 AndroidX 了!
Androidx迁移以及库和类对应映射关系
迁移androidx时第三方库应该尽量更新
是时候迁移至 AndroidX 了 | AndroidDevSummit 中文字幕视频
简介
jetifier工具是为了迁移support-library依赖为androidx依赖。其工作原理就是将jar或aar中的support依赖自动改为androidx依赖。当然也可以逆转。使用该方法,就无需使用android studio的gradle来进行迁移了
如何使用独立的Jetifier迁移到AndroidX?(How do I use the standalone Jetifier to migrate to AndroidX?)
网友评论