Google App Engine连接Android(Eclipse)设备端点错误

时间:2013-05-13 20:05:13

标签: java android google-app-engine endpoint google-cloud-endpoints

我刚刚开始使用android(Java)探索app引擎,我按照链接教我如何创建App Engine Connected Android Project。 https://developers.google.com/eclipse/docs/endpoints-androidconnected-gae

我完全遵循了链接中写的内容,

1)创建了一个连接android项目的新app引擎

2)从https://code.google.com/apis/console/#project

获取项目编号和API密钥

3)在Google API控制台中启用Google Cloud Messaging

4)在CloudEndpoints类

中将LOCAL_ANDROID_RUN设置为true

5)使用了谷歌api的模拟器(v17)

6)从android sdk manager

安装了android云消息库

7)我正在使用eclipse indigo

我在RegisterActivity.java

中遇到了这些错误
import messageEndpoint.MessageEndpoint;
import messageEndpoint.CollectionResponseMessageData;
import messageEndpoint.MessageData;

我在GCMIntentService.java

中得到了这些行的错误
import com.tez.deviceinfoendpoint.Deviceinfoendpoint;
import com.tez.deviceinfoendpoint.Deviceinfoendpoint.Builder;
import com.tez.deviceinfoendpoint.model.DeviceInfo;

和那样的错误:

无法将Deviceinfoendpoint解析为GCMIntentService.java类型 MessageEndpoint无法解析为RegisterActivity.java类型

我该怎么办?

2 个答案:

答案 0 :(得分:1)

右键点击应用引擎项目,然后选择Google - >生成云端点客户端库。清理项目并刷新。它应该工作。

答案 1 :(得分:0)

虽然我不太确定错误堆栈的原因,但我们鼓励右键单击app-engine项目,然后按照上面的建议选择生成云端点。但是,如果您非常需要自己创建端点,则必须确保将以下类似条目添加到webapp目录中的web.xml中。

        <param-name>services</param-name>
        <param-value>${package}.MyEndpoint</param-value>

确认上述条目后,

  1. 你可以制作模块
  2. 部署本地服务器并在模拟器上运行应用程序
  3. 否则,如果您正在使用生产服务器,

    1. 制作模块
    2. 部署到app-engine并在您选择的设备或模拟器上进行测试。
    3. 如果问题出在通过您创建的新端点公开的新端点/服务上,希望这可能对您有所帮助。谢谢!