Unable to resolve dependency for ':app@debug/compileClasspath': Could not find any version that...

新建Android项目打开后,报如下的错

Unable to resolve dependency for ':app@debug/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Open File
Show Details


Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Open File
Show Details


Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Open File
Show Details


Unable to resolve dependency for ':app@release/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Open File
Show Details


Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Open File
Show Details

经过实验,解决的方法如下:

1. 打开File->Project Structure

Unable to resolve dependency for ':app@debug/compileClasspath': Could not find any version that..._第1张图片

2.打开app->Properties

Unable to resolve dependency for ':app@debug/compileClasspath': Could not find any version that..._第2张图片

将Compile Sdk Version修改为API 27

Unable to resolve dependency for ':app@debug/compileClasspath': Could not find any version that..._第3张图片

点击保存

3. 打开build.gradle文件(Module:app)

Unable to resolve dependency for ':app@debug/compileClasspath': Could not find any version that..._第4张图片

Unable to resolve dependency for ':app@debug/compileClasspath': Could not find any version that..._第5张图片

将 v7:29.+ 改为v7:27.+  ,重新编译问题解决。

你可能感兴趣的:(Unable to resolve dependency for ':app@debug/compileClasspath': Could not find any version that...)