I am new to Android programming and Google App Engine. I followed the below documentation to run a sample app which registers my device: https://developers.google.com/eclipse/docs/endpoints-androidconnected-gae
When I run the app(on a device), I see the following:
1)Registration with Google Cloud Messaging...SUCCEEDED!
2)Registration with Endpoints Server...FAILED!
Unable to register your device with your cloud endpoints server. Either your cloud endpoints server is not deployed to app engine, or your settings need to be changed to run against a local instance by setting LOCAL_ANDROID_RUN to 'true' in CloudEndpointUtils.java
I also checked the LogCat and see the following exception:
01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): Exception received when attempting to register with server 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): java.net.SocketTimeoutException: failed to connect to /10.0.2.2 (port 8888) after 20000ms 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at libcore.io.IoBridge.connectErrno(IoBridge.java:159) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at libcore.io.IoBridge.connect(IoBridge.java:112) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at java.net.Socket.connect(Socket.java:872) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at libcore.net.http.HttpConnection.(HttpConnection.java:76) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at libcore.net.http.HttpConnection.(HttpConnection.java:50) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:340) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at libcore.net.http.HttpConnection.connect(HttpConnection.java:128) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:316) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at libcore.net.http.HttpEngine.connect(HttpEngine.java:311) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:290) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:240) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:81) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at libcore.net.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:197) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:77) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:964) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at com.googlecloudproject.GCMIntentService.onRegistered(GCMIntentService.java:163) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at com.google.android.gcm.GCMBaseIntentService.handleRegistration(GCMBaseIntentService.java:251) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at com.google.android.gcm.GCMBaseIntentService.onHandleIntent(GCMBaseIntentService.java:153) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at android.os.Handler.dispatchMessage(Handler.java:99) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at android.os.Looper.loop(Looper.java:158) 01-14 06:05:40.268: E/com.googlecloudproject.GCMIntentService(1831): at android.os.HandlerThread.run(HandlerThread.java:61)
Can anyone suggest on when this exception occurs and why my device is not able to register with cloud end points?
LOCAL_ANDROID_RUN = true
toLOCAL_ANDROID_RUN = false
. – Floris