Android 我又犯了一个错误
错误无法解析“”的依赖项:app@debug/compileClasspath':无法解析com.android。支持:appcompat-v7:27.1.1 Build.gradle文件是Android 我又犯了一个错误,android,Android,错误无法解析“”的依赖项:app@debug/compileClasspath':无法解析com.android。支持:appcompat-v7:27.1.1 Build.gradle文件是 apply plugin: 'com.android.application' android { compileSdkVersion 27 defaultConfig { applicationId "com.example.admin.myapplication"
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.admin.myapplication"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
这是您的完整gradle文件吗?请验证您的gradle Offline是否在Android Studio首选项中关闭。是的,我在Android StudioMy中关闭了我的gradle Offline。另一个gradle文件是buildscript{repositories{google()jcenter()}依赖项{classpath'com.android.tools.build:gradle:3.1.2'//注意:不要将应用程序依赖项放在此处;它们属于//单个模块build.gradle文件}}所有项目{repositories{google()jcenter()}任务清理(类型:Delete){Delete rootProject.buildDir}转到文件->使缓存无效并重新启动。尝试此操作。