Android real-time multiplayer: onRoomCreated gets erratic STATUS_NETWORK_ERROR_NO_DATA -


problem: onroomcreated returns status_network_error_no_data 5% of times, no reason can figure out.

the game worked 16 months of development (no problem of missing "permissions" in manifest or google play console) starting google play service 29 (that's "allegedly"... unrelated), unpredictable behaviour started, , blocking further attempt create room (same wrong statuscode on again, after restarting game).

the way make work again either restart game after 10-15 minutes or restart device (usually works not always).

the problem same on 3 different devices (no emulators here).

what found problem (on , elsewhere) related not leaving room (realtimemultiplayer.leave(...)) before trying create new one. waiting @ least end of "onleftroom" (plus 3 sec, in case) before trying create new room. no avail.

obviously following recommended guidelines: instantiate googleapiclient in oncreate, .connect in onstart, .disconnect in onstop (even if .connect on way)...

also notice that, because it's supposed "network_error", validating internet connection (with ping) before each attempt create room.

please, if have info issue, or if know how make google play create room after statuscode without restarting device, please let know because until our release date if forever postponed. lot.

[update 2]: app rewritten stop making automated room creations (hence less frequent requests), and... nothing... still same bug/problem/you-name-it ... on , on ... google play updated app "google play games" (and maybe "services") , kinda worked: 1 status_network_error_no_data in 2 weeks... i'm going sleep 2 months because i'm [redacted].

[update]: according this post, status_network_error_no_data used limit frequency of requests. because automate room creations , closings definitive answer. i'll update once again when it's validated or not. leave rest of answer because, although it's not directly related, not closing rooms induces errors.[end of update]

here's answer unpredictable behavior (didn't come of might still interested): in "onstart" , "onstop", calls/requests google play services (with mgoogleapiclient or not) must made before "super.onstart();" , "super.onstop();".

otherwise comes after "super.onstop();" interrupted before it's on (with randomness added device's speed , load), means call ".leave" open room fail, , prevent creation of new room (hence status_network_error_no_data error).

also notice variable mgoogleapiclient should not declared static, , remember call "mgoogleapiclient.disconnect();" in "onstop" (the example "buttonclicker" doesn't when it's recommended elsewhere).


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -