Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GoogleCloudMessaging cannot be resolved to a type

I am the only person that is experiencing this problem in the world. So I really need an expert, I think.

  • I am using Eclipse with Android Development Tools.
  • I have added ALL of the relevant libraries to the project
  • I have added gcm.jar

GoogleCloudMessaging cannot be resolved to a type

enter image description here

How can I resolve this problem? I cannot see any people that have the same problem.

Here are my library includes

enter image description here

I even tried changing Project Build Target, which does not help at all.

enter image description here

Then I finally tried the Java Build Target one. Which does not help too.

enter image description here

So I'm stuck here. I want only to use the GoogleCloudMessaging class. But I can't.

Any help is appreciated.

like image 455
Burak Yavuzalp Avatar asked Jun 26 '13 17:06

Burak Yavuzalp


3 Answers

The GoogleCloudMessaging class is in com.google.android.gms.gcm.GoogleCloudMessaging, which is part of the Google Play Services.

You'll need to download the Play Services through the SDK manager and then add that to your project as well.

like image 94
Raghav Sood Avatar answered Nov 06 '22 22:11

Raghav Sood


Thats right -- you need to add google-play-services-lib jar file from "your sdk folder/extras/google/google-play-services/libproject " some thing like that add this jar file and import the librariy after that ( CTRL + SHIFT + o ) and you will see it will fix

like image 31
Toprak Avatar answered Nov 06 '22 20:11

Toprak


gcm-server.jar is for the third party server. But to implment the GoogleCloudMessaging in your android app you need to include google-play-services.jar file

check here to know how to setup google play service

like image 5
stinepike Avatar answered Nov 06 '22 22:11

stinepike