Question

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. Eclipse complains about not being able to resolve the imports. For instance there is a read line under the com.myapp.deviceinfoendpoint portion of

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

Also there are red crosses on the following folders:

  • endpoint-libs/libdeviceinfoendpoint-v1/deviceinfoendpoint/deviceinfoendpoint-v1-generated-source

  • /myapp/endpoint-libs/libmessageEndpoint-v1/messageEndpoint/messageendpoint-v1-generated-source

  • /myapp/endpoint-libs (and sub folders)

and the following folders:

  • GCMIntentService.java

  • RegisterActivity.java

Was it helpful?

Solution

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

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/.
  2. Search replace all occurances of "com.google.api.services." in all your generated java source files.

I tried this and it worked. ]


P.S: you may want to know that Google Endpoints is currently experiencing some outage. 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

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

OTHER TIPS

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.

enter image description here

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/).
  • Remove the bad generated-source folders in the java build path.
  • Add the correct generated-source folders into the java build path.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top