“Could not resolve all files for configuration ':classpath'.” error in android studio

前提是你 提交于 2021-02-11 12:57:25

问题


error

I am getting this error just today.

Android studio is saying com.google.jimfs:jimfs:1.1. can't be downloaded.

Here is my gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        maven { url 'https://maven.google.com' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
}

allprojects {
    repositories {
        google()
        maven { url 'https://maven.google.com' }
    }
}

ext {
    compileSdkVersion = 22
    buildToolsVersion = "23.0.1"

    minSdkVersion = 9
    targetSdkVersion = 23
}

This only occurs if I download a project from the web. If I create the project then everything works fine.

Should I download com.google.jimfs:jimfs:1.1. myself or is anything missing in my gradle file?


回答1:


// build.gradle (Project: YOUR-APP)

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.1"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

// build.gradle (Module: App)

apply plugin: 'com.android.application'


android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.parse.starter"
        minSdkVersion 14
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        multiDexEnabled true

        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.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'androidx.navigation:navigation-fragment:2.3.2'
    implementation 'androidx.navigation:navigation-ui:2.3.2'
    implementation 'androidx.multidex:multidex:2.0.1'

    implementation 'com.parse.bolts:bolts-tasks:1.4.0'
    implementation 'com.parse:parse-android:1.13.0'
    implementation 'com.google.android.gms:play-services:12.0.1'
    implementation 'com.google.jimfs:jimfs:1.1'

    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}


来源:https://stackoverflow.com/questions/65262483/could-not-resolve-all-files-for-configuration-classpath-error-in-android-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!