迁移前期准备请移步:
https://www.jianshu.com/p/41de8689615d
项目中具体需要替换的配置如下:
配置文件方面
implementation "androidx.appcompat:appcompat:$androidxAppcompat"
implementation "androidx.recyclerview:recyclerview:$androidxRecyclerview"
implementation "androidx.constraintlayout:constraintlayout:$androidxConstraintlayout"
//实际代表的是
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
//使用到buttferKnife的项目还需替换
implementation "com.jakewharton:butterknife:$androidxButterknife"
annotationProcessor "com.jakewharton:butterknife-compiler:$androidxButterknifeCompiler"
//实际代表的是
implementation 'com.jakewharton:butterknife:10.2.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
混淆文件增加
-keep class com.google.android.material.** {*;}
-keep class androidx.** {*;}
-keep public class * extends androidx.**
-keep interface androidx.** {*;}
-dontwarn com.google.android.material.**
-dontnote com.google.android.material.**
-dontwarn androidx.**
主要搜索如下
android.support
androidx.core
androidx.appcompat
一般需要替换的都和以上关键词有关
网友评论