Android GcmListenerService不可用
我正在尝试发送上游消息,我想实现GcmListenerService,但Android studio中没有定义它。我的意思是,它在自动完成中不可用。 请查看下面发布的gradle文件,并让我知道如何解决此问题 build.gradle应用程序: } build.gradleproj:Android GcmListenerService不可用,android,google-cloud-messaging,gcmlistenerservice,Android,Google Cloud Messaging,Gcmlistenerservice,我正在尝试发送上游消息,我想实现GcmListenerService,但Android studio中没有定义它。我的意思是,它在自动完成中不可用。 请查看下面发布的gradle文件,并让我知道如何解决此问题 build.gradle应用程序: } build.gradleproj: 尝试将该行添加到你的应用程序build.gradle 编译'com.google.android.gms:play services gcm:11.0.2' 然后再次重新同步您的项目:不再推荐使用GCM。。检查此项
尝试将该行添加到你的应用程序build.gradle 编译'com.google.android.gms:play services gcm:11.0.2'
然后再次重新同步您的项目:不再推荐使用GCM。。检查此项以使用与GCM功能相同的最新FCM
我应该添加它还是用它替换旧的?你应该添加它,因为你没有它。请使用FCM而不是GCM。这将更容易实现,而且您需要为服务器密钥创建Firebase项目。
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':appcompat')
compile project(':securepreferences')
compile 'com.android.support:support-v4:25.2.0' // .0.1
compile 'com.google.android.gms:play-services:4.3.23'
compile 'com.github.chrisbanes.photoview:library:1.2.4'
compile 'com.google.code.gson:gson:2.7' // 2.4
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.squareup.retrofit:retrofit:1.8.0'
compile files('app/libs/android-viewbadger.jar')
compile files('app/libs/iDappsImagesLib_v0.2.jar')
compile files('app/libs/iDappsToolsLib_v0.1.jar')
compile files('gradle/wrapper/gradle-wrapper.jar')
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.7' // 1.8?
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}