2017-06-01 51 views
1

我需要推送通知添加到我的应用程序在Android中,但是当我添加火力地堡版本:8.1.0是比谷歌的服务插件所需的最低版本(9.0.0)

apply plugin: 'com.google.gms.google-services' 

我低这个错误

Error:(75, 0) Version: 8.1.0 is lower than the minimum version (9.0.0) required for google-services plugin. 

这是我bulld.gradle

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 21 
    buildToolsVersion "21.1.0" 

    defaultConfig { 
     minSdkVersion 16 
     targetSdkVersion 19 
     versionCode 25 
     versionName "2.4" 
     multiDexEnabled true 

    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

repositories { 
    maven { url "https://jitpack.io" } 
} 


dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.github.PhilJay:MPAndroidChart:v2.1.3' 
    compile 'com.github.lzyzsd:circleprogress:[email protected]' 
    compile 'com.commit451:PhotoView:1.2.4' 
    compile 'com.google.android.gms:play-services:8.1.0' 
    compile 'com.nineoldandroids:library:2.4.0' 
    compile 'com.daimajia.slider:library:[email protected]' 
    compile 'com.twotoasters.jazzylistview:library:1.2.1' 
    compile 'com.twotoasters.jazzylistview:library-recyclerview:1.2.1' 
    compile 'se.emilsjolander:stickylistheaders:2.7.0' 
    compile 'com.squareup.retrofit2:retrofit:2.0.2' 
    compile 'com.squareup.retrofit2:converter-gson:2.0.2' 
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.0' 
    compile 'me.nlmartian.silkcal:library:0.1.1' 
    compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' 
    compile 'com.android.support:recyclerview-v7:21.1.0' 
    compile 'com.pushbots:pushbots-lib:[email protected]' 
    compile 'com.android.support:support-v4:21.1.0' 
    compile 'com.makeramen:roundedimageview:2.3.0' 
    compile 'jp.wasabeef:blurry:2.1.1' 
    compile 'com.google.firebase:firebase-messaging:10.0.1' 
    testCompile 'junit:junit:4.12' 
} 
apply plugin: 'com.google.gms.google-services' 

-

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.2.3' 
     classpath 'com.google.gms:google-services:3.0.0' 
    } 
} 

我试图解决这个很多解决方案,但我不能,所以如果任何人都可以帮助我,请回答!

+0

你编译的方式太多依赖。而且很少有很过时的。 –

回答

2

需要所要求的火力所以使用上述或任何版本等于9.0.0

更新您的游戏服务,所以这个

compile 'com.google.android.gms:play-services:10.2.6' 

替换此

compile 'com.google.android.gms:play-services:8.1.0' 

和同步你的项目

Error:Execution failed for task ':app:processDebugGoogleServices'. > File google-services.json is missing.

获取配置文件为您的Android应用 要下载一个配置文件Android应用程式:

按照以下到火力地堡步骤

  • 登录并打开项目。
  • 单击设置图标并选择项目设置。
  • 在您的应用程序卡中,从列表中选择需要配置文件的应用程序包名称。
  • 点击google-services.json。

和复制google-services.json文件,并将其粘贴到你的项目的app文件夹

+0

谢谢你,在我添加这个并同步项目后,我得到了这个错误 –

+0

错误:执行任务':app:processDebugGoogleServices'失败。 >文件google-services.json丢失。没有它,Google服务插件就无法运行。 已搜索地点: –

+0

您需要下载'google-services。json'文件,并将其添加到项目的“应用程序”文件夹中,因为此文件包含供Firebase验证的重要信息。 –

1

检查的build.gradle和改变这种

compile 'com.google.android.gms:play-services:8.1.0' 

这个

compile 'com.google.android.gms:play-services:10.2.6' 

甚至更好 - remo如果您唯一需要的是Firebase云消息传递,那么此导入为

相关问题