Game crashes on iOS inside the preloader

hhjjj

  • Posts: 147
I spent the whole day to get rid of compiling errors while building the game in Xcode.
after 4 hours i solved every error. Then I test my game in the Ios simulator and it crashed during the  Preloader.
I have no idea what i did wrong. I spent another hour to search for the problem. But i didnt found anything besides an error message: Error: *** -[NSMutableArray
could someone give me an advice ?
thankyou in advance.

mat0pad

  • Posts: 364
Use the console  utility in xcode to see why it crashes and post what it outputs. It could be a memory problem or some segmentation fault.
   


                              

hhjjj

  • Posts: 147
thank you for your fast respond. i gonna check it out right now.

hhjjj

  • Posts: 147
still doesnt work it always freezes at 80 % and crashes  the only thing that the console say is:

end loading scene... 0
loading scene... 1
Reading Raw Layers...
Error: *** -[NSMutableArray
          replaceObjectAtIndex:withObject:]: attempt to replace with nil object at 50'

*** Terminating app due to uncaught exeption 'NSInvalidArgumentExeption', reason: '***[NSMutableArray replaceObjectAtIndex:withObject:]: attempt to replace with nil object at 50'
***call stack at first throw:

terminate called after throwing an instance of'NSExeption'
Program received signal:  "SIGABRT".

mat0pad

  • Posts: 364
Okay first "attemt to replace object with nil at 50" this shows you that it happens at line 50 in one of your behaviors/events..
Do you use lists?  Do you draw any number (when drawing a number convert it to text with the as text block) ? If so (to both) try post your behavior.

What the error means:
You pass an invalid argument to a method, as a nil pointer where a non-nil object is required.
   


                              

hhjjj

  • Posts: 147
thankyou for you reply

hhjjj

  • Posts: 147
I searched for the error but I didnt found it. Maybe someone could give me an advice how to fix the crash during the preloader at 80%. Here the Crash Log...

2014-02-10 17:23:05.006 AppScaffold[15110:1903] Assets : loadScenes
2014-02-10 17:23:05.015 AppScaffold[15110:1903] Loading Scene... 0
2014-02-10 17:23:05.022 AppScaffold[15110:1903] Reading Raw Layers...
2014-02-10 17:23:05.096 AppScaffold[15110:1903] Reading Layers...
2014-02-10 17:23:05.101 AppScaffold[15110:1903] End Loading Scene... 0
2014-02-10 17:23:05.103 AppScaffold[15110:1903] Loading Scene... 1
2014-02-10 17:23:05.106 AppScaffold[15110:1903] Reading Raw Layers...
2014-02-10 17:23:05.114 AppScaffold[15110:1903] Error: *** -[NSMutableArray replaceObjectAtIndex:withObject:]: attempt to replace with nil object at 50
2014-02-10 17:23:05.125 AppScaffold[15110:1903] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSMutableArray replaceObjectAtIndex:withObject:]: attempt to replace with nil object at 50'
*** Call stack at first throw:      
(
   0   CoreFoundation                      0x017e9be9 __exceptionPreprocess + 185
   1   libobjc.A.dylib                     0x0193e5c2 objc_exception_throw + 47
   2   CoreFoundation                      0x017e2c66 -[__NSArrayM replaceObjectAtIndex:withObject:] + 326
   3   AppScaffold                         0x000c8def -[TileLayer setTileAt:col:tile:] + 111
   4   AppScaffold                         0x000c3327 -[Scene readRawLayer:length:] + 695
   5   AppScaffold                         0x000c2fe7 -[Scene readRawLayers:numLayers:] + 439
   6   AppScaffold                         0x000c454b -[Scene loadFromXML:name:] + 2443
   7   AppScaffold                         0x000cbfdc -[GameModel readScenes:] + 348
   8   AppScaffold                         0x000bf82f -[Assets initAssets] + 303
   9   AppScaffold                         0x000c23f8 -[PreloadOperation main] + 264
   10  Foundation                          0x005c5bd2 -[__NSOperationInternal start] + 747
   11  Foundation                          0x005c5826 ____startOperations_block_invoke_2 + 106
   12  libSystem.B.dylib                   0x9aa8fa24 _dispatch_call_block_and_release + 16
   13  libSystem.B.dylib                   0x9aa81cf2 _dispatch_worker_thread2 + 228
   14  libSystem.B.dylib                   0x9aa81781 _pthread_wqthread + 390
   15  libSystem.B.dylib                   0x9aa815c6 start_wqthread + 30
)
terminate called after throwing an instance of 'NSException'
Program received signal:  “SIGABRT”.


Please could someone help me?
Thankyou in advance.

mat0pad

  • Posts: 364
Quote
Maybe someone could give me an advice how to fix the crash during the preloader at 80%

This is the reason why it crashes!  Error: *** -[NSMutableArray replaceObjectAtIndex:withObject:]: attempt to replace with nil object at 50
   


                              

hhjjj

  • Posts: 147
But how can I find the Behavior or Event with the Error?
I have thousands of behaviors and events.

hhjjj

  • Posts: 147
I can't do it. It just doesnt work i spent about 4 hours to search through events and behaviors even though i found nothing could it be a bug of xcode or stencyl itself?
How can I fix this issue i dont find anything.
Although I really appreciate that you try to help.

mat0pad

  • Posts: 364
Try to post your behaviors so we can check if there are any irregularities. Otherwise post your project or send it (PM).

Edit: it's unlikely that it's xcode or stencyl, because the error you are experiencing is very common (but it can be caused by many things).
   


                              

hhjjj

  • Posts: 147
 I'm from switzerland so i'm in school right now.
If i didnt fix the error at evening  i gonna send you my project but please dont publicite it, there's been 1000 of hours work i've put in this game. I trust you  :) . I really appriciate your hard work you do for me :)

« Last Edit: February 11, 2014, 03:27:05 am by hhjjj »

hhjjj

  • Posts: 147
I dont got it to work can i send you my project now?