Google云消息传递端点注册在本地失败

时间:2015-04-02 00:00:12

标签: android eclipse google-app-engine google-cloud-messaging

我使用eclipse使用Creating an App Engine Connected Android Project,并将LOCAL_ANDROID_RUN更改为true。我搜索了错误,似乎在添加--address = 0.0.0.0之前,在Web应用程序运行配置中的端口将使其工作,但它没有,所以任何帮助?

logcat的

04-01 19:43:27.524: E/com.imagine.GCMIntentService(2120): Exception received when attempting to register with server at http://10.0.2.2:8888/_ah/api/
04-01 19:43:27.524: E/com.imagine.GCMIntentService(2120): com.google.api.client.googleapis.json.GoogleJsonResponseException: 503 Service Unavailable
04-01 19:43:27.524: E/com.imagine.GCMIntentService(2120): {
04-01 19:43:27.524: E/com.imagine.GCMIntentService(2120):   "code" : 503,
04-01 19:43:27.524: E/com.imagine.GCMIntentService(2120):   "errors" : [ {
04-01 19:43:27.524: E/com.imagine.GCMIntentService(2120):     "domain" : "global",
04-01 19:43:27.524: E/com.imagine.GCMIntentService(2120):     "message" : "java.lang.NoClassDefFoundError: Could not initialize class com.imagine.EMF",
04-01 19:43:27.524: E/com.imagine.GCMIntentService(2120):     "reason" : "backendError"
04-01 19:43:27.524: E/com.imagine.GCMIntentService(2120):   } ],
04-01 19:43:27.524: E/com.imagine.GCMIntentService(2120):   "message" : "java.lang.NoClassDefFoundError: Could not initialize class com.imagine.EMF"

1 个答案:

答案 0 :(得分:0)

首先,所提供的信息较少,因此难以确定错误的实际原因。

其次,我认为你指的是一个使用Eclispe的旧文档。我建议使用现在是Google官方IDE的Android Studio,并按照tutorial中的说明进行操作。

这相对容易,因为配置和设置的工作量减少了一半。

有关示例代码,请参阅here