question

outofthebit avatar image
outofthebit asked

Problems getting the Local Player Profile

Hi, we're integrating GameCircle on our Kindle Apps using the C++ API. We were able to successfully link the libraries and use the API but we incurred in some problems when trying to load the local Player profile. After receiving the onServiceReady callback on the Java side (we couldn't find any similar callback on the C++ API), we forward it to our C++ library and call: [i]ProfilesClientInterface::getLocalPlayerProfile(this);[/i] from an object implementing the onGetLocalPlayerProfileCb callback [i] void APAmazonGameCircle::onGetLocalPlayerProfileCb(ErrorCode errorCode, const PlayerInfo* responseStruct, int developerTag) { switch ( errorCode ) { case NO_ERROR: if ( responseStruct && responseStruct->playerId ) { //do something with playerId } break; default: break; } } [/i] We usually receive a proper response with the PlayerId but, sometimes, if there is no internet connection, we get an exception in the gamecircle library which makes our app crash. Here's the LogCat extract when this happens: 01-14 14:52:43.448: D/ProfileToJavaInterface(6237): requestLocalPlayerProfile - called 01-14 14:52:43.573: D/GC_HttpNetworkClient(6237): Request: GET https://cortana-gateway.amazon.com/cortana/gateway/profile/getDefaultProfile?GameId=amzn1.application.2ec1be42d63c4288a8145be86d20aedb&locale=it_IT&gameId=amzn1.application.2ec1be42d63c4288a8145be86d20aedb 01-14 14:52:43.604: E/GC_NetworkCallFactory(6237): Connection exception encountered while executing request: com.amazon.ags.html5.comm.ConnectionException: java.net.UnknownHostException: Unable to resolve host " cortana-gateway.amazon.com": No address associated with hostname 01-14 14:52:43.635: D/RequestLocalPlayerProfileJniResponseHandler(6237): jniRequestPlayerProfile response - onSuccess 01-14 14:52:43.635: D/AGSProfileJni(6237): getLocalPlayerProfileResponseSuccess called 01-14 14:52:43.635: E/PlayerProfileResponseBuilder(6237): getPlayerInfoStruct - Could not retrieve alias 01-14 14:52:43.635: W/PlayerProfileResponseBuilder(6237): getPlayerInfoStruct - Could not retrieve playerId 01-14 14:52:43.635: E/dalvikvm(6237): JNI ERROR (app bug): accessed stale global reference 0x574542f2 (index 20668 in a table of size 209) 01-14 14:52:43.635: E/dalvikvm(6237): VM aborting This happened on all our Kindle devices (Fire, Fire HD, Fire HDX), but not consistently. Is this a known bug? Is there a workaround we can use to retrieve the PlayerId safely or are we doing anything wrong?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

outofthebit avatar image
outofthebit answered
UPDATE We updated the Amazon Apps SDK to the latest version (Android SDK 2.2.2) and the problem is still there, but the error log has slightly changed: 01-22 09:27:09.310: D/RequestLocalPlayerProfileJniResponseHandler(6256): jniRequestPlayerProfile response - onSuccess 01-22 09:27:09.310: D/AGSProfileJni(6256): getLocalPlayerProfileResponseSuccess called 01-22 09:27:09.310: E/PlayerProfileResponseBuilder(6256): getPlayerInfoStruct - Could not retrieve alias 01-22 09:27:09.310: W/PlayerProfileResponseBuilder(6256): getPlayerInfoStruct - Could not retrieve playerId 01-22 09:27:09.310: W/dalvikvm(6256): Invalid indirect reference 0x66b53460 in decodeIndirectRef 01-22 09:27:09.310: E/dalvikvm(6256): VM aborting 01-22 09:27:09.310: A/libc(6256): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 6256 We also realised that this error seems to happen only when it's a long time the device hasn't got internet connection.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi, Sorry for the late response. We have identified the issue and it would be fixed in the subsequent release. The new version of SDK is going to be available soon in couple of days. Thanks for reporting the issue.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.