Closed luobanghong closed 12 months ago
可以升级Kotlin 和相关依赖 ,如果项目中有强制要求某个版本kotlin,可以在Root gradle 中配置
ext {
kotlin_version = "1.7.20"
java_version = JavaVersion.VERSION_1_8
}
//如果和你的项目中Kotlin 依赖不一致。 强制统一项目中的Kotlin 版本依赖
ConfigurationContainer container = project.configurations
container.all { Configuration conf ->
ResolutionStrategy rs = conf.resolutionStrategy
rs.eachDependency { details ->
def requested = details.requested
if (requested.group == "org.jetbrains.kotlin") {
//统一内部 kotlin 库的版本
details.useVersion("$kotlin_version")
}
}
}
@luobanghong 在本Demo 中验证 了
// 人脸识别 活体检测 SDK 依赖 implementation 'io.github.anylifezlb:FaceRecognition:1.0.9'
implementation 'io.github.lucksiege:pictureselector:v3.11.1' //升级到新依赖,没有冲突,看看能否升级
可以解决冲突无问题
依赖库,io.github.anylifezlb:FaceRecognition:1.0.0
Android studio 4.1.1 gradle是6.5,同步不下来1.7的kotlin版本,项目中只有1.4相关版本。 1:1识别的demo,移植到项目中,提示以下错误 Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.1.