Google Cloud Messaging for Android Library not Found in the sdk Manager

自闭症网瘾萝莉.ら 提交于 2019-11-30 08:11:20

Install Google Play Services Library

For client side implementation of GCM use this link

For server side purposes follow the tutorial

Pls note that the tutorial explains how you can send messages to individual devices using the registration id and not to all devices at one go.

[Update]

I observed that still some people are using the deprecated library - GCM for android.

"Google Cloud Messaging for Android" is deprecated and no more used.GCM API's are now available as part of "Google Play Services".

Eventhough @anubhav's answer is correct for the asked question it is not recommended.

Select the 'Show Obsolete Packages' option in Packages menu and you will be able to view it and install.

Seems like this package is now obsolete. In order to see it in SDK Manager I had to check "Show obsolete packages" in the "Packages" menu

Edit (clarification of my answer)

I encountered this problem when trying to run Maven Android SDK Deployer. The version of the SDK deployer I used, was expecting gcm package installed (at least when running the deployer in its default configuration).

For other purposes, it's recommended to use the newer Google Play Services instead, as stated in one of the answers here.

To Add Google Play Services to Your Project (For Android Studio)

  1. Open the build.gradle (Module:app) file inside your application module directory.

  2. Add a new build rule under dependencies for the latest version of play-services.

For example:

apply plugin: 'com.android.application'

dependencies {
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.google.android.gms:play-services:6.5.87'
}

3.Save the changes and click Sync Project with Gradle Files in the toolbar.

4.Open your app's manifest file and add the following tag as a child of the <application> element:

<meta-data android:name="com.google.android.gms.version"
           android:value="@integer/google_play_services_version" />

go here for more details :Setting up google play services

Is there any solution?

Use something newer than that tutorial. The old GCM API was deprecated last May and was replaced with a new one.

Just tick the "Obsolete" checkbox in Android SDK Manager popup.

the Google Cloud Messaging for Android Library is obsolete,you can find it by do this: sdk manager --> packages(left corner)-->show obsolete packages,then you will see it.but google sugessts to use Googleplay Service instead.

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