game force closes right before i win

Put your problem here if it does not fit any of the other categories.

game force closes right before i win

Postby joel_gil » Sat May 29, 2010 8:33 pm

I developed a little game i played once on an itouch
i found it a good attempt to learn android

i only knew java so i developed it in pure java first and worke and now i ported it to android.

The game i working, playable, the objective becomes pretty clear from the beginnning, but right before u win (1-2 mins) it force closes.

Im guessing it has sth to do with my clicEnBoton() method since it involves objects at the edge of a matrix i created, but i dont see why since is the same logic as in plain java

You will see the code is very simple and probably inefficient, i did it with the little knowledge i have so far of android.

Please any comments will be appreiciated.

The idea of the game is not mine and is for learning purposes only.

Download java and xml from here:
http://dl.dropbox.com/u/522691/Colors.zip
hi!
Im here to learn (:
joel_gil
Freshman
Freshman
 
Posts: 5
Joined: Mon Jan 11, 2010 6:59 am
Location: Mexico

Top

Re: game force closes right before i win

Postby phix » Sat May 29, 2010 9:54 pm

What's the LogCat say when it force closes?
Posting questions without code is like going to the doctor and saying "it hurts, fix it."
phix
Master Developer
Master Developer
 
Posts: 230
Joined: Mon Mar 15, 2010 10:37 am

Re: game force closes right before i win

Postby joel_gil » Sat May 29, 2010 11:12 pm

It says:

/*
* Sorry!
* The aplication Colors
* (process com.games.colors)
* has stopped unexpectedly.
* Please try again.
* /

any comments are very welcome
hi!
Im here to learn (:
joel_gil
Freshman
Freshman
 
Posts: 5
Joined: Mon Jan 11, 2010 6:59 am
Location: Mexico

Re: game force closes right before i win

Postby phix » Sat May 29, 2010 11:19 pm

I should have specified. I'm sorry.

I would recommend debugging through your device or running it through your emulator. That way, when it crashes, whatever exceptions are occuring will be output to the logcat (either in eclipse or the "adb logcat" command line code). The message you gave is what is given to the user, and (clearly) doesn't provide us with any specifics on why it crashed.
Posting questions without code is like going to the doctor and saying "it hurts, fix it."
phix
Master Developer
Master Developer
 
Posts: 230
Joined: Mon Mar 15, 2010 10:37 am

Re: game force closes right before i win

Postby joel_gil » Sat May 29, 2010 11:37 pm

sorry about that, my noobiness is obvious heh

but anyway this is the logcat from the start to the end of the app:


05-29 17:32:01.069: INFO/System.out(766): debugger has settled (1490)
05-29 17:32:04.968: INFO/ActivityManager(563): Displayed activity com.games.colors/.Colors: 7735 ms
05-29 17:32:10.088: DEBUG/dalvikvm(612): GC freed 127 objects / 5880 bytes in 91ms
05-29 17:33:14.599: INFO/dalvikvm(766): Stack overflow, expanding (0x41048200 to 0x41048000)
05-29 17:33:14.678: INFO/dalvikvm(766): Shrank stack (to 0x41048200, curFrame is 0x41049e10)
05-29 17:33:38.710: DEBUG/AndroidRuntime(766): Shutting down VM
05-29 17:33:38.710: WARN/dalvikvm(766): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
05-29 17:33:38.710: ERROR/AndroidRuntime(766): Uncaught handler: thread main exiting due to uncaught exception
05-29 17:33:38.898: DEBUG/dalvikvm(766): GC freed 6106 objects / 257304 bytes in 100ms
05-29 17:33:39.339: ERROR/AndroidRuntime(766): java.lang.StackOverflowError
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at java.lang.Thread.currentThread(Thread.java:584)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at android.view.ViewRoot.checkThread(ViewRoot.java:2439)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at android.view.ViewRoot.invalidateChild(ViewRoot.java:522)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at android.view.ViewRoot.invalidateChildInParent(ViewRoot.java:540)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at android.view.ViewGroup.invalidateChild(ViewGroup.java:2332)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at android.view.View.invalidate(View.java:4437)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at android.view.View.setBackgroundDrawable(View.java:6580)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at android.view.View.setBackgroundColor(View.java:6473)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:141)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:154)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:154)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:154)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:158)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:158)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:158)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:158)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:158)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:150)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:158)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Colors.clicEnBoton(Colors.java:146)
05-29 17:33:39.339: ERROR/AndroidRuntime(766): at com.games.colors.Color
05-29 17:33:39.789: DEBUG/dalvikvm(563): GC freed 10032 objects / 599328 bytes in 118ms
05-29 17:33:39.789: INFO/Process(563): Sending signal. PID: 766 SIG: 3
05-29 17:33:39.799: INFO/dalvikvm(766): threadid=7: reacting to signal 3
05-29 17:33:39.869: INFO/dalvikvm(766): Wrote stack trace to '/data/anr/traces.txt'
05-29 17:33:41.569: INFO/Process(766): Sending signal. PID: 766 SIG: 9
05-29 17:33:41.579: INFO/ActivityManager(563): Process com.games.colors (pid 766) has died.
05-29 17:33:41.589: INFO/WindowManager(563): WIN DEATH: Window{43771e80 com.games.colors/com.games.colors.Colors paused=false}
05-29 17:33:41.769: WARN/InputManagerService(563): Got RemoteException sending setActive(false) notification to pid 766 uid 10024


hope u can help me, thanks
hi!
Im here to learn (:
joel_gil
Freshman
Freshman
 
Posts: 5
Joined: Mon Jan 11, 2010 6:59 am
Location: Mexico

Re: game force closes right before i win

Postby nicholas.hauschild » Sun May 30, 2010 2:46 am

Definately looks like some sort of recursive issue.
nicholas.hauschild
Master Developer
Master Developer
 
Posts: 310
Joined: Fri Dec 04, 2009 4:50 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: MSNbot Media and 15 guests