右键项目或模块,自动进行依赖库转换 配置gradle.properties,将依赖库中的代码也转为androidx
大多项目通过以上两步就可以转换完成了 但是annotationProcessor类型的依赖,是无法通过以上操作转换的,比如butterknife的注解处理器 使用旧版依赖就会报出以下错误,这时就要将版本号升级到支持androidx的版本
The given artifact contains a string literal with a package reference 'android.support.v4.content' that cannot be safely rewritten.
Libraries using reflection such as annotation processors need to be updated manually to add support for androidx.