解析失败:com.android.support:appcompat-v7:27.0.0
Failed to resolve: com.android.support:appcompat-v7:27.0.0
因此,我使用 targetSdkVersion 25 构建了一个应用程序,但后来我意识到它必须高于 26。我尝试将其升级到 API 27,但出现此错误:
Error:(24, 13) Failed to resolve: com.android.support:appcompat-v7:27.0.0
此消息下有三个选项:
- 安装存储库并同步项目
- 在文件中显示 在项目中显示
- 结构对话框
我的build.gradle(项目):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我的build.gradle(模块:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.simon.onequoteaday"
minSdkVersion 14 //9
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-ads:11.0.0'
compile 'com.android.support:appcompat-v7:27.1.1'
}
我还安装了所有 API 27 SDK。
任何可能的解决方案?谢谢
编辑:
我已经使用了其他线程提供的解决方案,但它们没有解决我的问题。我觉得我的问题不一样。
改变
buildtoolsversion '27.0.0'
和依赖项为:
compile 'com.android.support:appcompat-v7:27.0.0'
并保持互联网连接并下载它要求的任何存储库。
希望对您有所帮助。
将maven {url "https://maven.google.com"}
替换为google()
;位置已更改。
安装最新的 Android Studio 版本解决了问题
因此,我使用 targetSdkVersion 25 构建了一个应用程序,但后来我意识到它必须高于 26。我尝试将其升级到 API 27,但出现此错误:
Error:(24, 13) Failed to resolve: com.android.support:appcompat-v7:27.0.0
此消息下有三个选项:
- 安装存储库并同步项目
- 在文件中显示 在项目中显示
- 结构对话框
我的build.gradle(项目):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我的build.gradle(模块:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.simon.onequoteaday"
minSdkVersion 14 //9
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-ads:11.0.0'
compile 'com.android.support:appcompat-v7:27.1.1'
}
我还安装了所有 API 27 SDK。 任何可能的解决方案?谢谢
编辑: 我已经使用了其他线程提供的解决方案,但它们没有解决我的问题。我觉得我的问题不一样。
改变
buildtoolsversion '27.0.0'
和依赖项为:
compile 'com.android.support:appcompat-v7:27.0.0'
并保持互联网连接并下载它要求的任何存储库。
希望对您有所帮助。
将maven {url "https://maven.google.com"}
替换为google()
;位置已更改。
安装最新的 Android Studio 版本解决了问题