java - 无法解决android studio中的依赖关系,为什么会发生这种情况?
问题描述
我关闭了我的android项目,突然当我想再次打开我的项目时它给了我错误???
错误:无法解析“:app@debugAndroidTest/compileClasspath”的依赖关系:无法解析androidx.Test:runner:1.2.0。
显示详细信息 受影响的模块:app
错误:无法解析“:app@debugAndroidTest/compileClasspath”的依赖关系:无法解析androidx.Test.espresso:espresso-core:3.2.0。显示详细信息 受影响的模块:app
错误:无法解析“:app@debugAndroidTest/compileClasspath”的依赖关系:无法解析androidx.Test.ext:junit:1.1.1。显示详细资料
受影响的模块:app
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'
}
// 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.5.0'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
解决方案
您在依赖项中有一个大写 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'
推荐阅读
- android-jetpack-compose - 如何使用 HorizantalPager 为图像设置动画?
- python - 防止 Discord Reaction 消失(Discord 分页)
- css - 固定列中的字母
- node.js - 在 NodeJS 中使用 firebase-admin 创建自定义令牌
- c - Having trouble with addresses/pointers in my tree with structs as nodes. I don't seem to be inserting correctly. Thank you! [homework]
- python - 为什么 Python 解释器为不同的对象显示相同的内存位置?
- qt - 如何选择 QAudioDecoder 使用的 gstreamer mp3 解码器?
- intellij-idea - 如何安全地为 IntelliJ 中的单元测试提供用户凭据?
- outlook - 如何在资源管理器 Outlook 中显示起草邮件?C#
- swiftui - SwiftUI - 向上滚动时将文本移动到标题