导入com.google.android.gms.gcm.GoogleCloudMessaging无法解析 [英] The import com.google.android.gms.gcm.GoogleCloudMessaging cannot be resolved
问题描述
我试图在Android应用中使用通知,我发现很多tuto,但都使用不推荐使用的com.google.android.gcm pakage。我发现我必须使用com.google.android.gms.gcm.GoogleCloudMessaging pakage ...
,但我没有成功导入此包。
- 我已经从SDK管理器中下载了所有内容
- 在Properties项目中,我选择了Project Build target:Google API(17) >
- 在构建路径中,我还检查Google API。
和我总是有相同的错误:导入com.google.android.gms.gcm.GoogleCloudMessaging无法解析
我忘了添加一个jar或我错过的其他文件吗?
感谢
编辑:
我错过了此页面的信息其他discution上面)的设置:
http://developer.android.com/ google / play-services / setup.html#Setup
我只是不复制Google Play的lib。
无论您在项目中加入gcm.jar?
转至Android SDK管理器 - >其他 - > GCM。 Downlad它。转到特定位置。
它将包含gcm.jar.Add在您的项目中。
优秀教程是这里给出
http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
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.
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
这篇关于导入com.google.android.gms.gcm.GoogleCloudMessaging无法解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!