Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/385.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法解决android studio中的依赖关系,为什么会发生这种情况?_Java_Android_Build.gradle - Fatal编程技术网

Java 无法解决android studio中的依赖关系,为什么会发生这种情况?

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

我关闭了我的android项目,突然当我想再次打开我的项目时,它给了我错误

错误:无法解析的依赖项 ':app@debugAndroidTest/compileClasspath':无法解析 androidx。测试:runner:1.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':无法解析 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的类之后,我突然发现这些错误。是因为这个吗?你可能已经重构了你的代码,用“测试”代替了“测试”。