【发布时间】:2017-12-23 20:52:32
【问题描述】:
我已经在 macbook pro 上安装了 android studio,我确信我已经安装了所有必需的 SDK 以使其工作,但我仍然遇到错误问题。以下是错误信息
无法解析 ':app@debug/compileClasspath' 的依赖关系:无法解析 com.android.support:appcompat-v7:26.0.0-beta1。
无法解析 com.android.support:appcompat-v7:26.0.0-beta1。 要求:项目:app
没有可用于离线模式的 com.android.support:appcompat-v7:26.0.0-beta1 的缓存版本。
这是我的毕业作品
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.air.my1st"
minSdkVersion 15
targetSdkVersion 26
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:26.0.0-beta1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.0.0-beta1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
}
提前谢谢大家。
【问题讨论】:
-
将
google()添加到项目的build.gradle文件中的两个repositories闭包中。然后,将您的26.0.0-beta1依赖项切换到26.1.0。 -
我已经在两个存储库中都有 google() @CommonsWare
-
感谢在将 26.0.0-beta1 依赖项切换到 26.1.0 后它工作正常...感谢 @CommonsWare 兄弟
标签: android