Google App Engine - java.lang.NoClassDefFoundError: com.google.appengine.api.datastore.DatastoreServiceFactory

435 views
Skip to first unread message

Thiago Graça Couto Braun

unread,
Sep 5, 2014, 10:41:13 AM9/5/14
to google-a...@googlegroups.com

I have an app that is successfully uploading content to a server on Google´s App Engine. What I wanna do now, is retrieve that content using a DataStore constructed like this:

 DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();

Whenever I call that line, I got the following error:

09-05 11:21:37.922: E/AndroidRuntime(27138): FATAL EXCEPTION: AsyncTask #2
Caused by: java.lang.NoClassDefFoundError: 
com.google.appengine.api.datastore.DatastoreServiceFactory

I´m unsure at the moment if the problem lies on the application itself, or on the AppEngine. I have already tried to add some suggested JARs to my buildpath, for example appengine-agent.jar and appengineagentimpl.jar without success.

I would deeply appreciate any inputs on this. Thanks!

Vinny P

unread,
Sep 5, 2014, 4:08:32 PM9/5/14
to google-a...@googlegroups.com
It looks like you're trying to make the Datastore call directly from your Android device, which won't work since the DatastoreServiceFactory only has meaning to an application running within App Engine. 
 
Look into App Engine Endpoints: https://cloud.google.com/developers/articles/how-to-build-mobile-app-with-app-engine-backend-tutorial, it'll show you how to move data between your Android device and the App Engine service, and to save data to the datastore by moving it from Android Device -> App Engine app -> Datastore. 
 
-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com
Reply all
Reply to author
Forward
0 new messages