Reputation: 1122
I'm having a problem where if I run my app from installing it from the app store it's crashing (On multiple devices). But when I run the exact same code on the device from xCode it works fine.
I've been researching and the only suggestions I can find are to run in Release mode and change Optimization Level to fastest,smallest. Which I tried but it still doesn't crash. Heres the crash log I got:
Incident Identifier: 56DF41AE-4A6A-4328-A50E-03B2ECC245F5
CrashReporter Key: fabdf09dfea5dfb3a78e5ce49b1fda0291703647
Hardware Model: iPod4,1
Process: MobileScripts [356]
Path: /var/mobile/Applications/24524BCA-F897-45FE-87E5-3C807733C9C6/MobileScripts.app/MobileScripts
Identifier: MobileScripts
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2013-12-12 13:28:29.474 -0600
OS Version: iOS 6.1.5 (10B400)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x3195d29e __exceptionPreprocess + 158
1 libobjc.A.dylib 0x395dd97a objc_exception_throw + 26
2 CoreData 0x316fe0d6 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 294
3 CoreData 0x317566de -[NSManagedObjectContext save:] + 726
4 MobileScripts 0x0002ce0a -[XML parser:didEndElement:namespaceURI:qualifiedName:] (XML.m:105)
5 Foundation 0x3227b28a _endElementNs + 298
6 libxml2.2.dylib 0x398f3e58 xmlParseEndTag2 + 612
7 libxml2.2.dylib 0x398f5546 xmlParseTryOrFinish + 1658
8 libxml2.2.dylib 0x398f4ce8 xmlParseChunk + 208
9 Foundation 0x32279d66 -[NSXMLParser parse] + 482
10 MobileScripts 0x0002c664 -[XML parseXml:] (XML.m:32)
11 MobileScripts 0x00034686 -[WebService parse] (WebService.m:114)
12 Foundation 0x322986f8 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke_0 + 12
13 Foundation 0x321d81f4 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 196
14 Foundation 0x321d8110 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 56
15 CFNetwork 0x3163a45a ___delegate_didFinishLoading_block_invoke_0 + 22
16 CFNetwork 0x31639b3e ___withDelegateAsync_block_invoke_0 + 50
17 CFNetwork 0x31661fc6 ___performAsync_block_invoke_068 + 14
18 CoreFoundation 0x318a3748 CFArrayApplyFunction + 172
19 CFNetwork 0x31662426 RunloopBlockContext::perform() + 70
20 CFNetwork 0x315c6038 MultiplexerSource::perform() + 184
21 CoreFoundation 0x3193267e __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 10
22 CoreFoundation 0x31931ee4 __CFRunLoopDoSources0 + 208
23 CoreFoundation 0x31930cb2 __CFRunLoopRun + 642
24 CoreFoundation 0x318a3eb8 CFRunLoopRunSpecific + 352
25 CoreFoundation 0x318a3d44 CFRunLoopRunInMode + 100
26 GraphicsServices 0x354562e6 GSEventRunModal + 70
27 UIKit 0x337b92fc UIApplicationMain + 1116
28 MobileScripts 0x0002c58e main (main.m:16)
29 libdyld.dylib 0x39a14b1c tlv_initializer + 4
I see that it doesn't like what I have on line 105 in XML.m, which is just a context save:
[context save:&saveError];
And like I said this line works just fine when I run it from xcode. Does anyone have any suggestions on how I can get more information on the exception or make this issue occur while debugging?
Thanks for any help.
EDIT: I watched the device log during the crash and found out the exception is "'NSInternalInconsistencyException', reason: 'This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save operation.'". Any idea as to why this is only happening from the app store?
Upvotes: 1
Views: 568
Reputation: 3253
Connect the device to Xcode or the iPhone configurations program and watch the log.
Also how looks the scope of the save statement. Is there a try catch around it? You have a NSError
object that should have the info. Usualy it get logged using NSLog
.
Edit:
Where get the store created path wise and has the device enough room to create the store?
I am taking a guess. Are you delivering the persistence store with your app? Lets say a sqllight database that is part of the app? You may read files from your app but never write to. You need to move the pre made persistence store to one of the directories you have write access.
Upvotes: 1