我有一个问题并查看了可能重复的问题和答案,我认为其他人没有回答这个问题,所以在这里提问。
我更新了我的播放服务以使用融合位置提供程序,现在我的 gradle 中的 appcompat 显示错误。
所以我创建了一个新项目并检查了新项目上的 build.gradle 并且具有完全相同的 appcompat 但我的项目显示错误。
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "au.com.itmobilesupport.sqltwo"
minSdkVersion 17
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 {
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:appcompat-v7:26.+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-maps:11.0.0'
compile 'com.google.android.gms:play-services:11.0.1'
}
显示错误的是这一行:
compile 'com.android.support:appcompat-v7:26.+'
但在新项目中它很好。为什么我会收到错误消息?
更新:
如果我删除这两行,错误就会消失:
compile 'com.google.android.gms:play-services-maps:11.0.0'
compile 'com.google.android.gms:play-services:11.0.1'
但我需要它们,所以仍然有错误。
最佳答案
将这些行添加到您的 build.gradle
文件中,以获取您没有基于 Google site 的库.
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
关于android - 编译 appcompat v7 :26. + 为融合位置提供者添加播放服务时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44642350/