所以我使用的是Nougat版本的API 25,我想将我的应用程序更新为最近刚出版的版本ApI27。但每当我更新到27.0.1
时,此错误:
"Error:Failed to resolve: com.android.support:appcompat-v7.27.0.1"
不断发生。我不知道我做错了什么,我整天都在努力寻找解决方案。非常感谢您在这件事上的时间和帮助。
哦,我确信我已经下载了SDK版本以及SDK管理器中已经需要的所有文件。
我的Gradle文件(模块应用程序):
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.1'
defaultConfig {
applicationId "org.poream.dejaview"
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 'com.google.firebase:firebase-storage:11.6.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:design:27.0.1'
compile 'com.google.android.gms:play-services-maps:11.6.0'
compile 'com.android.support:appcompat-v7.27.0.1'
compile 'com.android.support:design:27.0.1'
compile 'com.google.android.gms:play-services-maps:11.6.0'
compile 'com.android.support:cardview-v7:27.0.1'
compile 'com.google.android.gms:play-services-location:11.6.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-database:11.6.0'
compile 'com.google.firebase:firebase-crash:11.6.0'
compile 'com.google.firebase:firebase-auth:11.6.0'
compile 'com.android.support:support-v4:27.0.1'
compile 'com.android.support:recyclerview-v7:27.0.1'
compile 'com.google.android.gms:play-services-auth:11.6.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
我的Gradle文件(项目):
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
答案 0 :(得分:2)
拼写错误(.
代替:
)
compile 'com.android.support:appcompat-v7.27.0.1'
使用:
compile 'com.android.support:appcompat-v7:27.0.1'
答案 1 :(得分:1)
添加 maven {url' https://docs.gitlab.com/ee/ci/yaml/README.html#tags'项目级别build.gradle
中的行 repositories {
maven { url 'https://maven.google.com/' }
}