Unable to resolve dependency for :app@debug/compileClasspath'

Problem Description

After using Android Studio New Project, error:

Unable to resolve dependency for :app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.;

Solution

The build.gradle project dependencies, namely dependencies in the code to make modifications.

# 原始代码
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.+'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

# 修改后代码
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:0.4'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
Published 21 original articles · won praise 11 · views 20000 +

Guess you like

Origin blog.csdn.net/y609532842/article/details/104682002