简体   繁体   English

appengine连接android项目到达时死亡

[英]appengine connected android project dead on arrival

I am following the tutorial to the letter; 我按照教程写了这封信; well, it's actually pretty basic so there is really nothing there. 好吧,它实际上是非常基本的,所以那里真的没什么。 But when I created the project, the android portion is not compiling. 但是当我创建项目时,android部分没有编译。 Eclipse complains about not being able to resolve the imports. Eclipse抱怨无法解析导入。 For instance there is a read line under the com.myapp.deviceinfoendpoint portion of 例如, com.myapp.deviceinfoendpoint部分下面有一个读取行

import com.myapp.deviceinfoendpoint.Deviceinfoendpoint;
import com.myapp.deviceinfoendpoint.Deviceinfoendpoint.Builder;
import com.myapp.deviceinfoendpoint.model.DeviceInfo;

Does anyone know how to fix this? 有谁知道如何解决这一问题? Maybe it's a build path issue but there are no instructions on how to set the build path. 也许这是一个构建路径问题,但没有关于如何设置构建路径的说明。

I am using mac osx mountain lion and eclipse juno 我正在使用mac osx mountain lion和eclipse juno

Also there are red crosses on the following folders: 以下文件夹中还有红色十字:

  • endpoint-libs/libdeviceinfoendpoint-v1/deviceinfoendpoint/deviceinfoendpoint-v1-generated-source 端点库/ libdeviceinfoendpoint-V1 / deviceinfoendpoint / deviceinfoendpoint-V1生成源

  • /myapp/endpoint-libs/libmessageEndpoint-v1/messageEndpoint/messageendpoint-v1-generated-source / MyApp的/端点库/ libmessageEndpoint-V1 / messageEndpoint / messageendpoint-V1生成源

  • /myapp/endpoint-libs (and sub folders) / myapp / endpoint-libs(和子文件夹)

and the following folders: 和以下文件夹:

  • GCMIntentService.java GCMIntentService.java

  • RegisterActivity.java RegisterActivity.java

Yup, it happens with me too. 是的,它也发生在我身上。 The reason this happens is because some how (not sure if its Eclipse or the GAE Plugin) the classes in endpoint-libs/libdeviceinfoendpoint-v1/deviceinfoendpoint/deviceinfoendpoint-v1-generated-source 发生这种情况的原因是因为endpoint-libs/libdeviceinfoendpoint-v1/deviceinfoendpoint/deviceinfoendpoint-v1-generated-source的类如何(不确定它的Eclipse或GAE插件)

are moved from the expected structure : 被移出预期的结构:

./deviceinfoendpoint-v1-generated-source
    |- com
       |-myapp
           |- deviceinfoendpoint
               |- Deviceinfoendpoint.java

to invalid structure : 结构无效:

./deviceinfoendpoint-v1-generated-source
    |- com
       |-google
           |- api
               |- services
                   |- com.myapp.deviceinfoendpoint
                       |- Deviceinfoendpoint.java

In theory this should not happen. 从理论上讲,这不应该发生。 But, well it does! 但是,它确实如此! :-) :-)

Try redoing the client library generation fresh, or try fixing them up manually. 尝试重新生成新的客户端库,或尝试手动修复它们。

[Update: Regenerating the Client Library again wont help. [更新:再次重新生成客户端库不会有帮助。 Either try the Command Line Mode. 尝试命令行模式。

Or a little hard way do it manually by 或者通过手动做一点努力

  1. moving all the contents of com.google.api.services/com.myapp/ package to com.myapp/ . com.google.api.services/com.myapp/包的所有内容移至com.myapp/
  2. Search replace all occurances of "com.google.api.services." 搜索会替换“com.google.api.services”的所有内容。 in all your generated java source files. 在所有生成的java源文件中。

I tried this and it worked. 我试过这个并且它有效。 ] ]


PS: you may want to know that Google Endpoints is currently experiencing some outage. PS:您可能想知道Google Endpoints目前正在经历一些中断。 You may have to wait a while before you can test it. 您可能需要等待一段时间才能进行测试。 Keep an eye on this issue : https://code.google.com/p/googleappengine/issues/detail?id=9214 请密切关注此问题: https//code.google.com/p/googleappengine/issues/detail?id = 9214

Update: It may help to refer to this Issue reported to Google : https://code.google.com/p/google-plugin-for-eclipse/issues/detail?id=117 更新:向Google报告此问题可能会有所帮助: https//code.google.com/p/google-plugin-for-eclipse/issues/detail?id = 117

The easiest solution is to create the project in the default location in the wizard. 最简单的解决方案是在向导的默认位置创建项目。 Then it just works (as of this writing, but it didn't use to). 然后它只是工作(截至撰写本文时,但它没有使用)。 You can move it to wherever you want at that point. 您可以将其移动到您想要的任何位置。

在此输入图像描述

You can create it in a different folder but then you'll have to: 可以在不同的文件夹中创建它,但是您必须:

  • Edit the modulePath entries in the descriptor.json files to remove the extra path (in my case changed com/test to com/). 编辑descriptor.json文件中的modulePath条目以删除额外路径(在我的情况下,将com / test更改为com /)。
  • Remove the bad generated-source folders in the java build path. 删除java构建路径中的错误生成源文件夹。
  • Add the correct generated-source folders into the java build path. 将正确的生成源文件夹添加到java构建路径中。

Which is pointless but included here for completeness. 这是毫无意义的,但为了完整性而包含在这里。 I admit I don't know what I'm doing in the descriptor.json files but it fixed the problem for me. 我承认我不知道我在descriptor.json文件中做了什么,但它解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM