0

我从创建一组 GCM 端点的标准 Google AppEngine 教程开始。该教程在本地和部署到生产中都非常有用。我正在使用 Eclipse Kepler 和标准的 Google Eclipse 插件。

我在 AppEngine 后端添加了一些新的端点 API。我在本地测试了新的 API,它们可以正常工作。我的新 API 是非常简单的数据存储对象。

接下来,我将更新后的 AppEngine 后端部署到生产环境。Google AppEngine 日志和仪表板告诉我,我的更新版本已成功上传并安装。API 发现 URL 显示了我的新 API 和以前的 API。以前的 API 仍然有效。新的 API 不起作用。只有一个应用程序版本。我正在从 Android 模拟器进行测试。

我已经广泛搜索了答案。唯一相关的答案是“清除 API 缓存,因为 AppEngine 积极缓存”,但我找不到任何可以清除“API 缓存”的地方?

我收到的错误如下:

09-04 18:12:20.450: D/CloudSync(703): syncAll(): IOException attempting to insert entity via AppEngine
09-04 18:12:20.450: W/System.err(703): java.net.ConnectException: failed to connect to /10.0.2.2 (port 8888) after 20000ms: isConnected failed: ECONNREFUSED (Connection refused)
09-04 18:12:20.481: W/System.err(703):  at libcore.io.IoBridge.isConnected(IoBridge.java:214)
09-04 18:12:20.481: W/System.err(703):  at libcore.io.IoBridge.connectErrno(IoBridge.java:152)
09-04 18:12:20.481: W/System.err(703):  at libcore.io.IoBridge.connect(IoBridge.java:112)
09-04 18:12:20.481: W/System.err(703):  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
09-04 18:12:20.491: W/System.err(703):  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
09-04 18:12:20.491: W/System.err(703):  at java.net.Socket.connect(Socket.java:842)
09-04 18:12:20.491: W/System.err(703):  at libcore.net.http.HttpConnection.<init>(HttpConnection.java:77)
09-04 18:12:20.491: W/System.err(703):  at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
09-04 18:12:20.491: W/System.err(703):  at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:351)
09-04 18:12:20.521: W/System.err(703):  at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:86)
09-04 18:12:20.531: W/System.err(703):  at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
09-04 18:12:20.531: W/System.err(703):  at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:308)
09-04 18:12:20.531: W/System.err(703):  at libcore.net.http.HttpEngine.connect(HttpEngine.java:303)
09-04 18:12:20.561: W/System.err(703):  at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:282)
09-04 18:12:20.571: W/System.err(703):  at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:232)
09-04 18:12:20.571: W/System.err(703):  at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)
09-04 18:12:20.581: W/System.err(703):  at libcore.net.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:188)
09-04 18:12:20.581: W/System.err(703):  at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:77)
09-04 18:12:20.611: W/System.err(703):  at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:960)
09-04 18:12:20.621: W/System.err(703):  at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
09-04 18:12:20.621: W/System.err(703):  at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
09-04 18:12:20.631: W/System.err(703):  at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)

好像我必须错过一些简单的东西。感谢您的建议。

更新:

我可以从 Google API Explorer 查看、探索并成功测试我的新/更新的 API。所以这似乎是Android App构建的问题。

4

1 回答 1

0

在今年(2013 年)的 3 月和 4 月时间范围内,我发现了许多非常相似但不完全相同的问题报告。查看 GPE 的发行说明,我发现大部分问题已在 5 月份由 Google 解决。我比较了我的 Eclipse GPE 和 SDK 版本,发现它们来自 3 月的时间范围。所以我做了以下。

1) a full update of all installed Eclipse plug-ins including the Google plug-ins
2) removed all generated Google Cloud Endpoint code from both the AppEngine project and the Android App project
3) updated the AppEngine project version number found in the appengine-web.xml
4) re-generated all of the Google Cloud Endpoint libraries
5) deployed the updated AppEngine
6) used the AppEngine Dashboard to set the new Default version to match the above
7) tested and verified the updated Endpoint APIs from the Google API Explorer and using the Datastore Viewer
8) Double checked that the following was set to false:
    public class CloudEndpointUtils {
        ...
        protected static final boolean LOCAL_ANDROID_RUN = false;
        ...
    }
8) Ran the updated Android application from the emulator (making sure that the emulator Run Configuration was set to a target using Google API 15+ and the Additional Emulator command line arguments was set to "-dns-server 8.8.8.8" (without the double quotes)  -- this is the Google DNS service)
9) verified that the Android application could save data to a new set of endpoints with no log errors, and the new stored entities are present confirmed through the Datastore Viewer.

我确认打开/关闭本地防火墙或打开/关闭防病毒软件没有任何区别。

问题解决了。我相信我只需要最新的软件更新。

于 2013-09-11T05:36:48.447 回答