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 .

我希望它能帮助你。

更多相关文章

  1. 8/人天,小记一次 JAVA(APP后台) 项目改造 .NET 过程(后台代码已完整
  2. tomcat启动web项目时候突然卡住

随机推荐

  1. Android实现自定义的 时间日期 控件
  2. 模仿天天动听的seekbar
  3. Android Studio中点击按钮跳转到其他页面
  4. Android MediaScannerJNI源码详解
  5. Android ViewPager 左右滑动-3
  6. Android 缩放图片
  7. "tabhost requires a tabwidget with id.
  8. Android(安卓)获取系统日期时间并且不断
  9. 获取Android版本信息和电话信息
  10. android listView实现单选