android 添加依赖出现Failed to resolve:"你添加的依赖名" 或者出现 debug@Compileclasspath问题

Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not download okhttp.jar (com.squareup.okhttp3:okhttp:3.9.0)

Open File
Show Details


解决方案:在整个工程的build.gradle中添加以下框内框内代码:


android 添加依赖出现Failed to resolve:

为了大家复制方便直接贴下添加的代码:

allprojects{

    repositories{

        jcenter()

        maven {

url"https://jitpack.io"

        }

    }

}

后来在app下的build.gradle  android{}中添加:

aaptOptions{cruncherEnabled =false   

 useNewCruncher =false}

ok了

你可能感兴趣的:(android 添加依赖出现Failed to resolve:"你添加的依赖名" 或者出现 debug@Compileclasspath问题)