未能解决:com.google.android.gms:play-services-gcm:7.5。+
I am trying to include GCM in my app.
我试着在我的应用中加入GCM。
I keep getting this error message :
我不断收到错误信息:
Failed to resolve: com.google.android.gms:play-services-gcm:7.5.+ | Install Repository and sync project | Show in Project Structure dialog
未能解决:com.google.android.gms:play-services-gcm:7.5。+ |安装库和同步项目|在项目结构对话框中显示
If I try to Install Repository and sync project i get this error:
如果我尝试安装储存库和同步项目,我得到这个错误:
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.
下载SDK信息…忽略未知的包过滤器“google-m2repository”的警告:包过滤器删除了所有包。没有什么可安装的。请考虑在没有包过滤器的情况下再次更新。
Here is my gradle file:
这是我的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.+'
// 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: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()
}
}
7 个解决方案
#1
11
Could you check that the necessary packages in your Android SDK Manager are up to date.
您能否检查一下您的Android SDK管理器中所需要的软件包是否最新。
And use
和使用
compile 'com.google.android.gms:play-services-gcm:7.5.0'
I hope it will helps you .
我希望它能帮助你。