android - Transloadit Dependency has different version for the compile (x) and runtime (y)
问题描述
I want to add the transloadit android sdk. The gradle build fails with the following error:
Android dependency 'io.tus.android.client:tus-android-client' has different version for the compile (0.1.5) and runtime (0.1.7) classpath. You should manually set the same version via DependencyResolution
I already use the dependencyResolution for the support library but I'm not sure what to do with transloadit. This is what I have so far.
configurations.all {
resolutionStrategy.force "com.android.support:support-v4:28.0.0"
resolutionStrategy.force "com.android.support:appcompat-v7:28.0.0"
}
解决方案
I found a different version of the same library in one of the submodules that caused the problem.
In my case a was able to remove the other dependency. But if you have library that uses i.e. an older version of a library you have to use you can do the following:
As described here -> https://developer.android.com/studio/build/gradle-tips#configure-project-wide-properties
you can override the version number of libraries used in submodules and libraries by adding ext in your root folder and specify which version should be used. In my case I override the versions for android v4 and v7 support libraries and the play-service-location library.
Here is what I had to add to my root gradle file
ext {
compileSdkVersion = 28
supportLibVersion = "28.0.0"
googleMapsLibVersion = "16.0.0"
}
allprojects {
repositories {
google()
jcenter()
}
configurations.all {
resolutionStrategy.force "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
resolutionStrategy.force "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
resolutionStrategy.force "com.google.android.gms:play-services-location:${rootProject.ext.googleMapsLibVersion}"
}
}
and in my module "app" I can use these versions as well
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:support-v13:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
implementation "com.google.android.gms:play-services-location:${rootProject.ext.googleMapsLibVersion}"
implementation "com.google.android.gms:play-services-maps:${rootProject.ext.googleMapsLibVersion}"
推荐阅读
- sql-server - 通过查询存储表获取每个存储过程的每日总执行次数?
- ubuntu - 将直线连接到蜂巢
- c# - 如何输出 IL 让 CLR 运行?
- java - Java:程序说索引不足,但代码中的所有内容都是正确的
- javascript - 如何在不刷新网页的情况下调用控制器的 IActionResult 方法?
- azure - macOS Big Sur(M1 芯片)上的 DefaultAzureCredential 错误
- excel - 浏览器版本的 Excel 绕过切片器保护
- python-3.x - 获得在文本流中写入的正确位置
- python - 如何使用分区蓝图在烧瓶中找到我的静态文件夹?
- python - 用于流式传输视频帧和音频的 Gstreamer 管道