Error running Google app engine mobile back end cl

2019-06-16 15:15发布

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

3条回答
唯我独甜
2楼-- · 2019-06-16 15:34

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

This seemed to solve it. bloody eclipse

查看更多
你好瞎i
3楼-- · 2019-06-16 15:53

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.

查看更多
欢心
4楼-- · 2019-06-16 15:58

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.

查看更多
登录 后发表回答