The import com.google.android.gms.gcm.GoogleCloudMessaging cannot be resolved

31,964

Whether you added gcm.jar in your project?

Go to Android SDK Manager->Extras->GCM. Downlad it. Go to particular location.

It will contain gcm.jar.Add in your project.

Excellent tutorial is given here

http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/

Share:
31,964
user2571821
Author by

user2571821

Updated on July 09, 2022

Comments

  • user2571821
    user2571821 almost 2 years

    I'm trying to use the notification in an Android app, I found many tuto but all use the com.google.android.gcm pakage which are deprecated. I see that I have to use the com.google.android.gms.gcm.GoogleCloudMessaging pakage... but I don't succeed to import this package.

    • I already download all the stuff from the SDK manager
    • In the Properties project I chose the Project Build target: Google APIs (17)
    • In the build path I check also the Google APIs.

    and I always have the same error: The import com.google.android.gms.gcm.GoogleCloudMessaging cannot be resolved

    Did I forget to add a jar or an other file I miss?

    thanks

    edit: I miss this page with the informations (give in the other discution above) for the setup: http://developer.android.com/google/play-services/setup.html#Setup

    I just don't copy the lib of Google Play.