我正尝试在我的应用中包含 GCM。
我不断收到此错误消息:
Failed to resolve: com.google.android.gms:play-services-gcm:7.5.+ | Install Repository and sync project | Show in Project Structure dialog
如果我尝试安装存储库和同步项目,我会收到此错误:
Loading SDK information... Ignoring unknown package filter 'extra-google-m2repository'Warning: The package filter removed all packages. There is nothing to install. Please consider trying to update again without a package filter.
这是我的 gradle 文件:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services-gcm:7.5.+'
//顶级构建文件,您可以在其中添加所有子项目/模块通用的配置选项。
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.google.gms:google-services:1.3+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
最佳答案
您能否检查Android SDK 管理器中的必要包是否是最新的。
并使用
compile 'com.google.android.gms:play-services-gcm:7.5.0'
希望对您有所帮助。
关于java - 无法解析 : com. google.android.gms :play-services-gcm:7. 5.+,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32240265/