Android报错之Could not resolve all files for configuration ‘:app:debugRuntimeClasspath‘.

Android报错之Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

解决方法如下

1.在Project的build.gradle的两处加入google()

在这里插入图片描述

// 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:7.1.2'
    }
}
allprojects {
    
    
    repositories {
    
    
        google()
        jcenter()
//        maven {url 'https://dl.bintray.com/chaozhouzhang/maven' }
    }
}
allprojects {
    
    
    repositories {
    
    
        maven {
    
     url 'https://jitpack.io' }
    }
}
task clean(type: Delete) {
    
    
    delete rootProject.buildDir
}

成功解决!

猜你喜欢

转载自blog.csdn.net/qq_61963074/article/details/126576172