9

I am following the tutorial Getting started with mobile backend.

However when I try run the downloaded client I get the following exception:

05-23 14:48:49.960: E/AndroidRuntime(15384): FATAL EXCEPTION: main
05-23 14:48:49.960: E/AndroidRuntime(15384): java.lang.NoClassDefFoundError: com.google.cloud.backend.android.GCMIntentService
05-23 14:48:49.960: E/AndroidRuntime(15384):    at com.google.cloud.backend.android.CloudBackendAsync.<init>(CloudBackendAsync.java:71)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at com.google.cloud.backend.android.CloudBackendMessaging.<init>(CloudBackendMessaging.java:47)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at com.google.cloud.backend.android.CloudBackendActivity.onCreate(CloudBackendActivity.java:75)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at com.google.cloud.backend.android.sample.guestbook.GuestbookActivity.onCreate(GuestbookActivity.java:60)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at android.app.Activity.performCreate(Activity.java:5206)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at android.app.ActivityThread.access$600(ActivityThread.java:140)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at android.os.Handler.dispatchMessage(Handler.java:99)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at android.os.Looper.loop(Looper.java:137)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at android.app.ActivityThread.main(ActivityThread.java:4898)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at java.lang.reflect.Method.invokeNative(Native Method)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at java.lang.reflect.Method.invoke(Method.java:511)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
05-23 14:48:49.960: E/AndroidRuntime(15384):    at dalvik.system.NativeStart.main(Native Method)

I have no idea why this is happening from the out of the box sample code from Google. Does anyone know how to fix this?

Thanks, Jason

Jason
  • 4,034
  • 4
  • 40
  • 62

3 Answers3

10

Project -> Properties -> Java Build Path -> Order & Export and ensure Android Private Libraries are checked for your project

This seemed to solve it. bloody eclipse

Jason
  • 4,034
  • 4
  • 40
  • 62
  • 6
    You saved my time.. this is working. Once you check Android Private Libraries, clean your project and run. It worked for me. :) No need to remove proguard. – Yasitha Waduge Jun 15 '13 at 16:14
  • @Egor: Until I did a clean and rebuild it didn't work for me neither. So the combination "pick device or avd with Google APIs" and "check option at java build path"did it. – Chris Jul 09 '13 at 20:20
6

The solution is to combine both answers (from Jason and user2453622).

You have to export Android private Libraries and have a device/AVD with Google APIs.

Baldrick
  • 61
  • 3
  • 1
    might be an idea to combine the answers in your answer, or suggest that one incorporate the other in a comment. This answer is probably best as a comment on the question. – Awalias Jun 05 '13 at 10:49
  • Thank you for a suggestion but I can't comment on a question or other answers. – Baldrick Jun 05 '13 at 11:04
1

I ran into this until I specifically picked an AVD that was based on the Google API. Google APIs (Google Inc.) as the Target Name.