Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 841
user2571821 Avatar asked Jul 11 '13 09:07

user2571821


1 Answers

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/

like image 73
Shadow Avatar answered Sep 25 '22 01:09

Shadow