Androidx回退Android-Support库踩到的坑

由于一些很坑的原因,导致提供的aar需要从androidx框架回退到旧的support库,通过androidx关键字删除了代码中所有的依赖后,编译还是报了错误,显示还有依赖androidx的地方。

Caused by: com.android.builder.errors.EvalIssueException: This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected: androidx.versionedparcelable:versionedparcelable:1.0.0, androidx.fragment:fragment:1.0.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.core:core:1.0.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.viewpager:viewpager:1.0.0, androidx.collection:collection:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.lifecycle:lifecycle-common:2.0.0, androidx.arch.core:core-common:2.0.0, androidx.annotation:annotation:1.0.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.lifecycle:lifecycle-runtime:2.0.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0

使用命令:gradle -q :app:dependencies可以查看模块app的所有依赖树。

debugAnnotationProcessorClasspath - Resolved configuration for annotation-processor for variant: debug
\--- com.github.hotchemi:permissionsdispatcher-processor:4.1.0
     +--- org.jetbrains.kotlin:kotlin-stdlib:1.2.71
     |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.2.71
     |    \--- org.jetbrains:annotations:13.0
     +--- com.squareup:javapoet:1.9.0
     +--- com.squareup:kotlinpoet:1.0.0-RC1
     |    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.50
     |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.2.50 -> 1.2.71 (*)
     |    \--- org.jetbrains.kotlin:kotlin-reflect:1.2.50
     |         \--- org.jetbrains.kotlin:kotlin-stdlib:1.2.50 -> 1.2.71 (*)
     +--- com.github.hotchemi:permissionsdispatcher-annotation:4.1.0
     \--- androidx.annotation:annotation:1.0.0

分析上面的输出,发现工程依赖的三方库里存在androidx的依赖。查阅官网文档,得知permissionsdispatcher4.x以后只支持Jetpack。遂改为3.3.1,重新编译,问题解决!

【参考资料】
Android将Androidx项目回退到support项目
Andorid开发,support 迁移androidx,或androidx回退androidx 对比
PermissionsDispatcher

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

kiba_zwei

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值