• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Intermittent error

Brian Berry

Well-Known Member
I created a complex game that works fine most of the time but once every 40 or so rounds it will mess up. I'm trying to see if there is a bug so I play the game in the same exact order to recreate the problem but sometimes there is a problem and sometimes there isn't a problem. I've never had a program do this before. Can anybody shed some light on what might be causing the problem? I can recreate the problem but its random. I checked out all the code that is involved but there isn't a problem. Just Most of the time the code works flawlessly and sometimes it doesn't. Weirdest thing I've ever seen.

--calmchess
 
There is no error it just starts having the wrong values. and doesn't play correctly. It's really strange for it to play flawlessly sometimes and other times it isn't working correctly. Ever had a Android program do that? This is a first for me.
 
That is indeed frustrating. When you say wrong values do you mean the variables in your code have incorrect values?
Logic errors are among the most challenging problems to fix. You have to try and isolate the location of the problem, and debug your code by setting breakpoints and stepping through it line by line.
 
I isolated the code that may be causing the problem I'll keep working on it. The app also crashes once in a blue moon. It is frustrating because this app is very close to being ready to publish to the play store. Thanks for your time I'll keep debugging it.
 
I've been there many times It's deeply irritating to have an unexplained program behaviour, but you just have to be persistent and work logically through the problem.

Btw the crash should be easier to work out because you'll get a stack trace.

Good luck.
 
Last edited by a moderator:
Back
Top Bottom