错误Android应用程序连接到谷歌云终端:找不到类 [英] Error connecting android app to Google Cloud Endpoints: could not find class

查看:173
本文介绍了错误Android应用程序连接到谷歌云终端:找不到类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经与谷歌云端点的API,我试图连接到它写一个Android应用程序。我跟着下面的教程:

https://developers.google.com/appengine/docs/java/端点/ consume_android

所以,我说我的SRC文件夹中的JAR的内容,我复制了上市库lib和我增加了code。当我试图启动应用程序,它与坠毁以下错误:

  12月2日至26日:19:52.874:E / dalvikvm(17558):找不到类
    com.google.api.services.utenteendpoint.Utenteendpoint $生成器',从方法引用
    com.example.androidgcetest.MainActivity.onCreate
 十二月2日至26日:19:53.004:E / AndroidRuntime(17558):致命异常:主要
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):java.lang.NoClassDefFoundError的:com.google.api.services.utenteendpoint.Utenteendpoint $生成器
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在com.example.androidgcetest.MainActivity.onCreate(MainActivity.java:22)
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在android.app.Activity.performCreate(Activity.java:4465)
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在android.app.ActivityThread.access $ 600(ActivityThread.java:127)
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1158)
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在android.os.Handler.dispatchMessage(Handler.java:99)
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在android.os.Looper.loop(Looper.java:137)
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在android.app.ActivityThread.main(ActivityThread.java:4448)
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在java.lang.reflect.Method.invokeNative(本机方法)
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在java.lang.reflect.Method.invoke(Method.java:511)
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:823)
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
十二月2日至26日:19:53.004:E / AndroidRuntime(17558):在dalvik.system.NativeStart.main(本机方法)

你知道这个错误的可能原因?

编辑:
我也发现了这个上面。

报告的日志之前

  16 02-26:51:57.780:W / dalvikvm(1230):无法解析LCOM /谷歌/ API /服务/ utenteendpoint / Utenteendpoint $生成器的超类; (20)
02-26 16:51:57.780:W / dalvikvm(1230):Link类的LCOM /谷歌/ API /服务/ utenteendpoint / Utenteendpoint $生成器;'失败的


解决方案

添加sources.jar文件也LIBS您的Andr​​oid项目的文件夹,就像其他的jar文件。

感谢拉福在我先前的职位找到错字误差

I have built an API with Google Cloud Endpoints and I am trying to connect to it writing an Android application. I followed the following tutorial:

https://developers.google.com/appengine/docs/java/endpoints/consume_android

So, I added the content of the jar on my "src" folder, I copied the listed libraries to lib and I added the code. When I tried to start the application, it crashed with the following error:

        02-26 12:19:52.874: E/dalvikvm(17558): Could not find class 
    'com.google.api.services.utenteendpoint.Utenteendpoint$Builder', referenced from method 
    com.example.androidgcetest.MainActivity.onCreate


 02-26 12:19:53.004: E/AndroidRuntime(17558): FATAL EXCEPTION: main
02-26 12:19:53.004: E/AndroidRuntime(17558): java.lang.NoClassDefFoundError: com.google.api.services.utenteendpoint.Utenteendpoint$Builder
02-26 12:19:53.004: E/AndroidRuntime(17558):    at com.example.androidgcetest.MainActivity.onCreate(MainActivity.java:22)
02-26 12:19:53.004: E/AndroidRuntime(17558):    at android.app.Activity.performCreate(Activity.java:4465)
02-26 12:19:53.004: E/AndroidRuntime(17558):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
02-26 12:19:53.004: E/AndroidRuntime(17558):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
02-26 12:19:53.004: E/AndroidRuntime(17558):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
02-26 12:19:53.004: E/AndroidRuntime(17558):    at android.app.ActivityThread.access$600(ActivityThread.java:127)
02-26 12:19:53.004: E/AndroidRuntime(17558):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
02-26 12:19:53.004: E/AndroidRuntime(17558):    at android.os.Handler.dispatchMessage(Handler.java:99)
02-26 12:19:53.004: E/AndroidRuntime(17558):    at android.os.Looper.loop(Looper.java:137)
02-26 12:19:53.004: E/AndroidRuntime(17558):    at android.app.ActivityThread.main(ActivityThread.java:4448)
02-26 12:19:53.004: E/AndroidRuntime(17558):    at java.lang.reflect.Method.invokeNative(Native Method)
02-26 12:19:53.004: E/AndroidRuntime(17558):    at java.lang.reflect.Method.invoke(Method.java:511)
02-26 12:19:53.004: E/AndroidRuntime(17558):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:823)
02-26 12:19:53.004: E/AndroidRuntime(17558):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
02-26 12:19:53.004: E/AndroidRuntime(17558):    at dalvik.system.NativeStart.main(Native Method)

Do you know the possible cause of this error?

EDIT: I also found this before the log reported above

02-26 16:51:57.780: W/dalvikvm(1230): Unable to resolve superclass of Lcom/google/api/services/utenteendpoint/Utenteendpoint$Builder; (20)
02-26 16:51:57.780: W/dalvikvm(1230): Link of class 'Lcom/google/api/services/utenteendpoint/Utenteendpoint$Builder;' failed

解决方案

Add the sources.jar file also to libs folder of your android project, just like the other jar files.

Thanks Raffo for finding the typo error in my earlier post

这篇关于错误Android应用程序连接到谷歌云终端:找不到类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆