Android dependency库版本冲突解决方案

在Unity中打包Android应用时遇到一个错误,提示Android依赖'support-compat'的编译版本(27.0.2)与运行时版本(27.1.1)不一致。解决方法包括在Gradle文件中针对冲突库进行排除或通过Groovy脚本指定统一的版本号。具体解决方案一是排除特定模块,二是全局设定支持库版本为27.0.2。
摘要由CSDN通过智能技术生成

Unity打包安卓APK遇到问题:

Android dependency 'com.android.support:support-compat' has different version for the compile (27.0.2) and runtime (27.1.1) classpath. You should manually set the same version via DependencyResolution

解决方案一:

        在知道是哪个库文件引用存在冲突的可以在gradle中,在库引用的地方添加

api ('com.linecorp.linesdk:linesdk:5.4.0') {
        exclude group: 'com.android.support', module: 'support-compat'
    }

解决方案二:

        Grovvy脚本指定版本号。在gradle文件中添加代码

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support' && !details.requested.name.contains('multidex') ) {
                details.useVersion '27.0.2' // 指定想要的版本号
            }
        }
    }
}

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

coding·life

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

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

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

打赏作者

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

抵扣说明:

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

余额充值