Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [Android] File saving randomly fails, random crashes

Author
Message
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 27th Jul 2016 04:50
We've been testing Wordspionage with the newest flavor of AppGameKit for about a week now. The app now exhibits very sporadic crashes and I believe I have narrowed it down to file writing. I have a method which checks the saved file's size immediately after it has been written and my error log noted that the size should have been 82692, but it was reported a 1 by GetFileSize(). I'm assuming what is now happening is file saving is no longer a blocking command and the file was not yet finished being written by the system. However, this method does work 99.999% of the time. Wordspionage does attempt to send a log of the error to our servers at this point. However the app seems to crash and close before we get to the point where we dump the data file into a new file and send the error logs. The crash is not accompanied by an OS messages either.

We've also noticed random crashes without any warning from the OS or our built in debug messages. None of which happen in our currently published version.

We're ultimately updating only because we need to update Facebook, but we're concerned about releasing this update due to the new instability in the app.

I've also notice that the Chartboost ads sometimes get stuck when showing. I see them begin to enter the screen, but they never finish their animation. I imagine this is a bug in the version of Chartboost you guys are using, but it may be related. It is hard to tell.

I plan to place a small delay and recheck of the file size for up to 0.5 seconds to see if this will work.
Other suggestions are welcome.


Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 28th Jul 2016 22:40
Well, I've added in the delay before checking the file and still getting sporadic crashes. One of them actually asked me to report it to google play, but it's not showing in my dev console
Next step will be that I have to root my device to see the state of the saved files after the crash. I've got SetErrorMode(1) set, but not getting any messages. Guess I'll have to try SetErrorMode(2) and see if I can get anything without being connected to logcat.
Sigh...
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 29th Jul 2016 00:41 Edited at: 29th Jul 2016 00:43
did u use #option_explicit
at top?
this can help to get better code for the compiler.
my experience in app crash with agk - often i also had it in the ide and with debug mode on it was a bug in agk.
or incompatible with some os versions.

maybe keep an eye at the Benchmarking commands if the memory run over.
AGK (Steam) V2.0.20 : Windows 10 Pro 64 Bit : AMD (16.3.2) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 29th Jul 2016 03:30
Hey Markus!
I wan't aware of #option_explicit
I'll give that a go and see if anything pops up.
I can't imagine any possible benchmarking issues, the app is lightweight on the images and the data file doesn't go over 100kb. Is there a specific command to monitor the memory usage? Could be I'm causing a leak somewhere, but with tier 1 I would hope that's fairly impossible (unless it's a bug). Debugging an issue like this is exactly what hell is made of
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 29th Jul 2016 03:36
Hrm... #option_explicit doesn't seem to be very intelligent.


How does that make a lick of sense?
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 29th Jul 2016 05:25
SetErrorMode(2) finally started popping up an error in the windows build tonight. Interestingly (mildly) is that it was saying a text object didn't exist, though it appeared to. Somehow the dim containing that text's id was losing the reference. Can't figure out where, but I've worked around it and so far so good in Windows. I'll be pushing to our android alpha testers in the next 24 hours and I hope that gets it, but why the heck would that delete our saved files? Almost ready to rewrite this in Unity.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 29th Jul 2016 09:36
hi,
it looks like the interpreter still have some problems
maybe use the new arrays commands.
https://www.appgamekit.com/documentation/guides/12_array_changes.htm
#option_explicit prevent auto declaration - it help very much.
i think the most stable version u will get with native development android studio/xcode.

AGK (Steam) V2.0.20 : Windows 10 Pro 64 Bit : AMD (16.3.2) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 29th Jul 2016 17:39
Yeah switching out all those dims would be an immense headache. We used them a lot because it was the only option at the time.

I got the crash report from Google Play today. It's not necessarily AGK's fault, but it looks like an issue with Chartboost or possibly AGK's implementation.

Here's the crash report. Null ref in Chartboost. Not sure what version Paul is using, but it probably needs an update.


Hopefully Paul is watching this thread!
It still doesn't make sense why this crash would delete our saved data. Unless the crash just happens to occur in the middle of a save process and corrupts the file.
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 30th Jul 2016 04:54
Yay! A new error has occurred! No crashes this time, but seems to be directly related to file writing. After a game session is complete we save a screenshot of the game to the local storage. We've now had the same issue on 2 separate devices where the image file doesn't seem to save properly. Also the game data file was corrupted at this point too.

So something odd is going on with file saving. We've not changed anything with this since AppGameKit 2.0.12 and our app is quite stable using that version I can only assume ti is a lovely bug in AGK. This is a major disappointment. I figured after a year that AppGameKit would have it's ducks in a row, but apparently not. Looks like We'll just have to forgo the update in hopes that AppGameKit will address these file saving issues or I'll just rewrite with this with Unity. I was hoping to avoid that, but if we want to continue to have an up to date and stable product it looks like AppGameKit is not the way to go. Very disappointed and sad.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 2nd Aug 2016 16:36
I've had a look and I can't see any changes to Android file saving process, although you mention that saving a screenshot isn't working, there is currently a bug in GetImage that I've fixed for the next version. I've updated the Chartboost SDK to version 6.4.2 for the next version in case that is causing the problem.

When it crashes can you go into the device settings, developer options, make sure USB debugging is turned on, then tap "Take bug report" and email the result to me? That should help track down the cause. You can get the same result by having USB debugging turned on and plugging the device into a computer running Android Studio, the Android Monitor window will list the system log which should give details about any crashes.

Login to post a reply

Server time is: 2024-11-25 04:53:55
Your offset time is: 2024-11-25 04:53:55