How to move Cloud Endpoints generated sources.jar library into Android project

你说的曾经没有我的故事 提交于 2019-11-29 05:07:33

This problem is solved in Eclipse by adding a linked resource to the directory at

your-appengine-project/endpoint-libs/libYourEndpoint-v1/yourendpoint/yourendpoint-generated-source/

You can do this in Eclipse by adding a source link in Properties->Java Build Path->Source Link

After this your Android or client project will see any changes generated using "Google->Generate Client Endpoint Library"

The idea is that the wizard that generates the client library also copies it into your client project.

But that depends on e.g. how you initially created your projects, and even if it does work, what if you have multiple clients projects, or change your client project... so here are some ideas:

  • I found a file that specifies which project the client libraries will get copied to (in the .settings folder): com.google.gdt.eclipse.appengine.swarm.prefs:

    connectedProject=[target-android-project-name]
    eclipse.preferences.version=1

Manually changing this file worked for me, but I haven't tried manually creating it if it doesn't exist.

  • The other solution, which you asked about, is to manually copy the file. In my case I was able to copy the generated files from [gae-project]\endpoint-libs to [android-project]\endpoint-libs. If I remember correctly, you must then find the sources jar file (it is amongst the file you copied and will be easy to find) and extract those into "[endpoint-name]-v1-generated-source" folder. You create this folder in the same folder where you found the jar.

Clearly that is is not a great solution, so..

  • There is an endpoints.cmd/bat that can be used instead of the GPE Wizard - I suggest you look to see if it has a command for copying and extracting the generated library. I believe you would find it in the 'bin' folder of the GAE/J SDK.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!