java - 找不到满足版本约束的“com.google.code.findbugs:jsr305”版本
问题描述
当为 realse 生成签名的 APK 时,我收到以下错误消息:
Cannot find a version of 'com.google.code.findbugs:jsr305' that satisfies the version constraints:
Dependency path 'XX:app:unspecified' --> 'androidx.test.espresso:espresso-core:3.1.2-alpha01' --> 'com.google.code.findbugs:jsr305:2.0.1'
Constraint path 'XX:app:unspecified' --> 'com.google.code.findbugs:jsr305' strictly '1.3.9' because of the following reason: debugRuntimeClasspath uses version 1.3.9
这是我的应用程序:gradle
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.XX.XX"
minSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.guava:guava:22.0-android'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.2-alpha01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.2-alpha01'
}
但是,如果我为调试而构建它可以正常工作,但是当我生成签名版本时,我收到了这条消息,我试图谷歌但似乎没有找到正确的答案。
解决方案
我今天遇到了类似的问题,发现了这个: https ://github.com/trello/RxLifecycle/issues/154
通过在依赖项下的(模块:应用程序)中编辑 Gradle 脚本 build.gradle 来解决我的问题,添加:
androidTestImplementation 'com.google.code.findbugs:jsr305:1.3.9'
我最初尝试了不同的版本号,但收到一个错误,告诉我要使用哪个版本,因此您可能需要尝试几次。
推荐阅读
- c++ - std::source_location 作为非类型模板参数
- terraform - 为什么 Terraform 使用表达式“插值”
- spring-boot - 如何启用 /refresh Actuator 端点并绕过 CSRF 限制?
- java - 使用 bukkit 加载地图的问题
- java - 如何使用 IText7 创建 QR 码的示例
- php - WP post_updated $post_after, $post_before 显示相同的产品类别
- php - 在开始之前访问具有 INT 的数组中的数据
- macos - macOS 高山脉中的颤振医生错误
- c# - 如何在c#中将一个数字四舍五入到十位?
- arrays - 如何从C#中的类数组中输出一个值