我创建了一个新的 android 项目,它显示构建错误
我尝试了现有的答案
- 无法解析:com.android.support:appcompat-v7 24.0.1 https://stackoverflow.com/questions/39519515/failed-to-resolve-com-android-supportappcompat-v7-24-0-1
- 我尝试使 android studio 无效并重新启动
错误是
错误:无法解决依赖关系
':app@debugAndroidTest/compileClasspath':无法解析
朱尼特:朱尼特:4.12。
错误:无法解决依赖关系
':app@releaseUnitTest/compileClasspath':无法解析
朱尼特:朱尼特:4.12。
错误:无法解决依赖关系
':app@debugUnitTest/compileClasspath':无法解析
朱尼特:朱尼特:4.12。
错误:无法解决依赖关系
':app@debugAndroidTest/compileClasspath':无法解析
com.google.code.findbugs:jsr305:2.0.1。
我的 gradle 文件的依赖项部分
dependencies
{
implementation 'androidx.appcompat:appcompat:1.0.2'
testImplementation 'junit:junit:4.12'
}
我不明白这是我的第一个项目。
我的项目等级是
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我的应用程序等级是
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
android
{
configurations.all
{
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
}
dependencies
{
implementation 'androidx.appcompat:appcompat:1.0.2'
testImplementation 'junit:junit:4.12'
}
在您的 build.gradle 文件中添加以下存储库,
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
你忘记将其添加到你的依赖项中
androidTestCompile 'com.google.code.findbugs:jsr305:3.0.0'
该问题是由 espresso 库引起的,如果您无法删除它,请将其添加到您的应用程序 gradle 中
android
{
configurations.all
{
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)