1. Are you ready for the Galaxy S20? Here is everything we know so far!

Intermittent error

Discussion in 'Android Development' started by Brian Berry, May 4, 2019.

  1. Brian Berry

    Brian Berry Well-Known Member
    Thread Starter

    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
     



    1. Download the Forums for Android™ app!


      Download

       
  2. Deleted User

    Deleted User Guest

    What do you mean by "mess up"? What's the error?
     
  3. Brian Berry

    Brian Berry Well-Known Member
    Thread Starter

    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.
     
  4. Deleted User

    Deleted User Guest

    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.
     
  5. Brian Berry

    Brian Berry Well-Known Member
    Thread Starter

    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.
     
  6. Deleted User

    Deleted User Guest

    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.
     
    #6 Deleted User, May 4, 2019
    Last edited by a moderator: May 5, 2019
Loading...

Share This Page

Loading...