解析失败:com.google.android.gms:play-services-gcm:8.7+
Failed to resolve: com.google.android.gms:play-services-gcm:8.7+
我想在我的应用程序中使用一些 Google 服务,所以我将这一行添加到 .gradle
文件:com.google.android.gms:play-services-gcm:8.7+
。但是在尝试同步项目后我得到了这个错误:
Failed to resolve: com.google.android.gms:play-services-gcm:8.7+
我检查了 Whosebug 上的所有可用答案。他们建议为 Google repository
和 Google play services
安装 sdk,我做到了。这是我电脑上安装的sdks的截图:
这里是 gradle 文件代码:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.project.android.eyedetection"
minSdkVersion 10
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/localization/LocalizedFormats_fr.properties'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile project(':libraries:opencv')
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.android.gms:play-services:8.7+'
compile files ('libs/commons-math-2.2.jar')
compile files ('libs/commons-math-2.2-javadoc.jar')
compile files ('libs/commons-math-2.2-sources.jar')
}
我尝试删除 +
,但没有解决问题。
我该如何解决这个问题?
编辑: 正如 Stanojkovic 和 Gabriele Mariotti 所建议的那样,使用 8.4 解决了这个问题,这是因为我错误地尝试使用尚未发布的 8.7。谢谢大家
试试
com.google.android.gms:play-services-panorama:8.4.0
您的问题取决于
compile 'com.google.android.gms:play-services:8.7+'
此版本尚未发布(apk 仍在发布中,但IDE 中的库未public)
使用最后一个稳定版本:
compile 'com.google.android.gms:play-services:8.4.0'
我想在我的应用程序中使用一些 Google 服务,所以我将这一行添加到 .gradle
文件:com.google.android.gms:play-services-gcm:8.7+
。但是在尝试同步项目后我得到了这个错误:
Failed to resolve: com.google.android.gms:play-services-gcm:8.7+
我检查了 Whosebug 上的所有可用答案。他们建议为 Google repository
和 Google play services
安装 sdk,我做到了。这是我电脑上安装的sdks的截图:
这里是 gradle 文件代码:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.project.android.eyedetection"
minSdkVersion 10
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/localization/LocalizedFormats_fr.properties'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile project(':libraries:opencv')
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.android.gms:play-services:8.7+'
compile files ('libs/commons-math-2.2.jar')
compile files ('libs/commons-math-2.2-javadoc.jar')
compile files ('libs/commons-math-2.2-sources.jar')
}
我尝试删除 +
,但没有解决问题。
我该如何解决这个问题?
编辑: 正如 Stanojkovic 和 Gabriele Mariotti 所建议的那样,使用 8.4 解决了这个问题,这是因为我错误地尝试使用尚未发布的 8.7。谢谢大家
试试
com.google.android.gms:play-services-panorama:8.4.0
您的问题取决于
compile 'com.google.android.gms:play-services:8.7+'
此版本尚未发布(apk 仍在发布中,但IDE 中的库未public)
使用最后一个稳定版本:
compile 'com.google.android.gms:play-services:8.4.0'