how to connect the library gcm in gradle?

血红的双手。 提交于 2019-12-24 04:15:17

问题


I downloaded the example link

ran it and it worked fine. but now I want to do it in the android studio. I try to connect the library:

compile "com.google.android.gms:play-services:6.1.71" 

but the classes are not visible and the package too

 android:name="com.google.android.gcm.GCMBroadcastReceiver"

how to connect the library GCM in gradle?


回答1:


You should install Google Cloud Messaging for Android Library in a SDK Manager . After doing it Android Studio will be see all classes from gcm.jar.




回答2:


You need the gcm-server.jar. Add compile("com.ganyo:gcm-server:1.0.2") in build.gradle as the following:

dependencies { compile("com.ganyo:gcm-server:1.0.2") }



来源:https://stackoverflow.com/questions/27246293/how-to-connect-the-library-gcm-in-gradle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!