我是谷歌应用程序引擎连接安卓项目的新手。当我尝试创建和运行这个项目时,我得到了下面的异常
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)
这个错误是什么,为什么我会得到这个错误。请帮我找到解决方案。
发布于 2016-03-11 20:56:35
Android应用程序接收到的HTTP响应是一个404。这通常意味着服务器收到了请求,但找不到所请求的资源,或者资源不存在。
由于堆栈跟踪表明您正在尝试访问终结点,导致此404响应的几个可能原因包括:
在仔细检查URL之后,您应该能够通过检查https://developers.google.com/apis-explorer/?base=https://[YOUR-PROJECT-ID].appspot.com/_ah/api#p/
上的API Explorer来查看部署和公开了哪些端点。如果您在此处看不到要尝试访问的终结点,请通过重新部署应用程序来确认该终结点确实已部署。
如果您已经确认它已经部署,但在API Explorer中仍然看不到它,请检查端点方法代码,以确保正确的注释已经就位。对于要公开的公共非静态、非桥接方法,该类必须具有@Api
批注。此外,@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
可用于防止端点被访问。如果要公开方法,请确保注释是而不是 present。
一旦您通过API Explorer确认了一个可访问的端点,您就可以更好地测试来自Android应用程序的连接。
发布于 2014-03-02 00:24:18
检查此问题的答案here
很可能你从来没有正确部署过你的项目。尝试重新部署它或检查https://developers.google.com/apis-explorer/?base=https://[YOUR_PROJECT_ID].appspot.com/_ah/api#p/
https://stackoverflow.com/questions/17740713
复制相似问题