如何在不作为模块使用的情况下更新第三方库中的依赖项?
How to update dependencies inside of third-party libraries without using as a module?
当我们在项目中使用第三方库时,这个第三方库可能使用了旧的dependencies 在它的项目中,这可能会导致我们项目中的错误或错误。我们如何强制第三方库使用与我们的依赖项不冲突的更新版本的依赖项?
如果您使用的是 .AAR 文件,请连接到相关开发人员以将依赖项替换为较新的依赖项。
您可以从第三方库中排除一个模块,并在项目中包含该模块的更新版本。
使用exclude
删除库中包含的模块。
dependencies {
implementation 'com.google.firebase:firebase-inappmessaging-display-ktx:20.1.0', {
exclude group: 'io.grpc', module: 'grpc-okhttp' // removing grpc-okhttp included with the library
}
implementation 'io.grpc:grpc-okhttp:1.40.1'
}
当我们在项目中使用第三方库时,这个第三方库可能使用了旧的dependencies 在它的项目中,这可能会导致我们项目中的错误或错误。我们如何强制第三方库使用与我们的依赖项不冲突的更新版本的依赖项?
如果您使用的是 .AAR 文件,请连接到相关开发人员以将依赖项替换为较新的依赖项。
您可以从第三方库中排除一个模块,并在项目中包含该模块的更新版本。
使用exclude
删除库中包含的模块。
dependencies {
implementation 'com.google.firebase:firebase-inappmessaging-display-ktx:20.1.0', {
exclude group: 'io.grpc', module: 'grpc-okhttp' // removing grpc-okhttp included with the library
}
implementation 'io.grpc:grpc-okhttp:1.40.1'
}