com.google.api.client.googleapis.json.GoogleJsonResponseException:404在谷歌应用程序引擎未找到连接的Andr​​oid项目 [英] com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found in google app engine connected android project

查看:307
本文介绍了com.google.api.client.googleapis.json.GoogleJsonResponseException:404在谷歌应用程序引擎未找到连接的Andr​​oid项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来连接的Andr​​oid项目谷歌应用程序引擎。当我试图创建和运行该项目,我得到下面的异常

I Am new to Google app engine connected android project. when i tried creating and running the project i got below exception

07-19 07:22:18.437: W/System.err(1854): com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
07-19 07:22:18.437: W/System.err(1854): Not Found
07-19 07:22:18.447: W/System.err(1854):     at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:111)
07-19 07:22:18.447: W/System.err(1854):     at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:38)
07-19 07:22:18.447: W/System.err(1854):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:312)
07-19 07:22:18.447: W/System.err(1854):     at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1042)
07-19 07:22:18.447: W/System.err(1854):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
07-19 07:22:18.457: W/System.err(1854):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
07-19 07:22:18.457: W/System.err(1854):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
07-19 07:22:18.457: W/System.err(1854):     at com.example.endpointdemoproject.MainActivity$EndpointsTask.doInBackground(MainActivity.java:55)
07-19 07:22:18.457: W/System.err(1854):     at com.example.endpointdemoproject.MainActivity$EndpointsTask.doInBackground(MainActivity.java:1)
07-19 07:22:18.457: W/System.err(1854):     at android.os.AsyncTask$2.call(AsyncTask.java:287)
07-19 07:22:18.467: W/System.err(1854):     at java.util.concurrent.FutureTask.run(FutureTask.java:234)
07-19 07:22:18.467: W/System.err(1854):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
07-19 07:22:18.467: W/System.err(1854):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
07-19 07:22:18.467: W/System.err(1854):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
07-19 07:22:18.477: W/System.err(1854):     at java.lang.Thread.run(Thread.java:856)

这是什么错误,为什么我得到这个。请帮我找到解决办法。

What is this error and why I'm getting this. Please help me to find solution.

推荐答案

的Andr​​oid应用程序接收HTTP响应是的 404 。这通常意味着该服务器接收到的请求,但无法找到资源请求或不存在

The HTTP response the Android application is receiving is a 404. This normally means that the server received the request but could not find resource requested or that it doesn't exist.

由于您的堆栈跟踪表明您正试图达成一个端点,这404响应的几个可能的原因是:

As your stack trace indicates you are attempting to reach an endpoint, a few possible causes of this 404 response are:


  • 由Android应用程序中使用的URL是不正确

  • 的端点尚未部署

  • 端点是不可见

  • 端点和类没有正确注释

在仔细检查网址,你应该能够看到通过检查,在API浏览器哪些终端部署和外露<$c$c>https://developers.google.com/apis-explorer/?base=https://[YOUR-PROJECT-ID].appspot.com/_ah/api#p/,通过@easycheese提到。
如果你没有看到这里的端点,你要访问,确认它实际上是由重新部署的应用程序部署。

After double-checking the URL, you should be able to see which endpoints are deployed and exposed by checking the API Explorer at https://developers.google.com/apis-explorer/?base=https://[YOUR-PROJECT-ID].appspot.com/_ah/api#p/, as mentioned by @easycheese. If you do not see the endpoint here that you are trying to reach, confirm that it is in fact deployed by redeploying your application.

如果您已确认它的部署,但仍然没有看到它的API资源管理器,查看端点法code,以确保正确标注到位。这个类必须有一个 @Api 标注为公共非静态,非桥接的方式暴露出来。此外, @ApiResourceProperty(忽略= AnnotationBoolean。 TRUE) 可被访问使用prevent的端点。确保注释是的不可以 present如果您要公开方法。

If you've confirmed it's deployed but still do not see it in the API Explorer, review the endpoint method code to ensure the proper annotations are in place. The class must have an @Api annotation for its public non-static, non-bridged methods to be exposed. In addition, the @ApiResourceProperty(ignored = AnnotationBoolean.TRUE) may be used to prevent an endpoint from being accessible. Ensure that annotation is not present if you which to expose the method.

一旦你已经确定通过API浏览器可访问端点,则应是更好地从你的Andr​​oid应用程序测试连接。

Once you've confirmed an accessible endpoint via the API Explorer, you should then be in a better position to test connectivity from your Android application.

这篇关于com.google.api.client.googleapis.json.GoogleJsonResponseException:404在谷歌应用程序引擎未找到连接的Andr​​oid项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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