Java 无法解决android studio中的依赖关系,为什么会发生这种情况?
我关闭了我的android项目,突然当我想再次打开我的项目时,它给了我错误 错误:无法解析的依赖项 ':app@debugAndroidTest/compileClasspath':无法解析 androidx。测试:runner:1.2.0 显示细节 受影响模块:应用程序Java 无法解决android studio中的依赖关系,为什么会发生这种情况?,java,android,build.gradle,Java,Android,Build.gradle,我关闭了我的android项目,突然当我想再次打开我的项目时,它给了我错误 错误:无法解析的依赖项 ':app@debugAndroidTest/compileClasspath':无法解析 androidx。测试:runner:1.2.0 显示细节 受影响模块:应用程序 apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkV
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.gerobokgo"
minSdkVersion 21
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.firebaseui:firebase-ui-database:4.3.2'
implementation 'com.google.firebase:firebase-storage:16.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.Test:runner:1.2.0'
androidTestImplementation 'androidx.Test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.Test.ext:junit:1.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
//Layout
implementation 'com.google.android.material:material:1.0.0'
//recylervieer
implementation 'androidx.recyclerview:recyclerview:1.0.0'
// image slider
implementation 'com.github.therealshabi:AutoImageFlipper:v1.4.1'
//image Cropper
implementation 'com.theartofdev.edmodo:android-image-cropper:2.1.+'
implementation 'androidx.work:work-runtime:2.2.0'
}
错误:无法解析的依赖项
':app@debugAndroidTest/compileClasspath':无法解析
androidx。测试。浓缩咖啡:浓缩咖啡核心:3.2.0。显示受影响的详细信息
模块:应用程序
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.gerobokgo"
minSdkVersion 21
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.firebaseui:firebase-ui-database:4.3.2'
implementation 'com.google.firebase:firebase-storage:16.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.Test:runner:1.2.0'
androidTestImplementation 'androidx.Test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.Test.ext:junit:1.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
//Layout
implementation 'com.google.android.material:material:1.0.0'
//recylervieer
implementation 'androidx.recyclerview:recyclerview:1.0.0'
// image slider
implementation 'com.github.therealshabi:AutoImageFlipper:v1.4.1'
//image Cropper
implementation 'com.theartofdev.edmodo:android-image-cropper:2.1.+'
implementation 'androidx.work:work-runtime:2.2.0'
}
错误:无法解析的依赖项
':app@debugAndroidTest/compileClasspath':无法解析
Test.ext:junit:1.1。显示细节
受影响模块:应用程序
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.gerobokgo"
minSdkVersion 21
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.firebaseui:firebase-ui-database:4.3.2'
implementation 'com.google.firebase:firebase-storage:16.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.Test:runner:1.2.0'
androidTestImplementation 'androidx.Test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.Test.ext:junit:1.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
//Layout
implementation 'com.google.android.material:material:1.0.0'
//recylervieer
implementation 'androidx.recyclerview:recyclerview:1.0.0'
// image slider
implementation 'com.github.therealshabi:AutoImageFlipper:v1.4.1'
//image Cropper
implementation 'com.theartofdev.edmodo:android-image-cropper:2.1.+'
implementation 'androidx.work:work-runtime:2.2.0'
}
如果依赖项中有大写字母T,请使用下面的一个
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
发生这种情况是因为我创建了一个名为Test的模型类。是因为这个吗?在此之前,我可以打开应用程序,但在我创建了一个名为Test的类之后,我突然发现这些错误。是因为这个吗?你可能已经重构了你的代码,用“测试”代替了“测试”。