how do i fix the sigabrt error?

Hello,

I'm new in IOS programming and I need your help.


When I start my app (Single View Application) in the ios-simulator I become this error:


Thread 1: signal SIGABRT

terminating with uncaught exception of type NSException

code in main.m file:

#import <UIKit/UIKit.h>

#import "AppDelegate.h"

int main(int argc, char * argv[]) {

@autoreleasepool {

return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); Here is the error

}

}


I dont understand this error.

Thank you for your help.

Answered by bob133 in 43990022

I think I've figured it out: you said you use a storyboard, but your app is trying to load a nib. That's why it's getting so confused. What you need to do is tell your app that it's supposed to look for a storyboard, not a nib. Here's how:


• Select your project file in the Project Navigator

• In the sidebar with "Projects" and "Targets," select your app under "Targets"

• Click the Info tab

• Expand "Custom iOS target properties" if necessary

• Look for something like "Main nib file base name." If you see it, click it and change it to "Main storyboard file base name."

• Make sure the name to the right matches the name of your storyboard file

• Now build and run.


Hopefully this will clear up the problem. 😉


To recap, an app crashes with the SIGABRT error whenever an exception (a fatal error) is raised and no recovery is possible, such as during the start-up sequence, where any problem is critical.

Yes, that's the one. What are the contents of that area after one run of your app?

This:



2015-08-22 08:05:41.219 Kapitel2[681:18681] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/.../Library/Developer/CoreSimulator/Devices/39F18BDB-2DD1-4759-8348-AB949BAD82C2/data/Containers/Bundle/Application/DABC6E49-14AE-4F76-B933-471AFCC8053A/Kapitel2.app> (loaded)' with name 'Main''

*** First throw call stack:

(

0 CoreFoundation 0x00a943b4 __exceptionPreprocess + 180

1 libobjc.A.dylib 0x00553e02 objc_exception_throw + 50

2 CoreFoundation 0x00a942dd +[NSException raise:format:] + 141

3 UIKit 0x01228b80 -[UINib instantiateWithOwner:options:] + 554

4 UIKit 0x0122b865 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 247

5 UIKit 0x00e23f94 -[UIApplication _loadMainNibFileNamed:bundle:] + 72

6 UIKit 0x00e243c7 -[UIApplication _loadMainInterfaceFile] + 292

7 UIKit 0x00e22798 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1575

8 UIKit 0x00e45af6 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke3142 + 68

9 UIKit 0x00e1f6a6 -[UIApplication workspaceDidEndTransaction:] + 163

10 FrontBoardServices 0x035fdccc __37-[FBSWorkspace clientEndTransaction:]_block_invoke_2 + 71

11 FrontBoardServices 0x035fd7a3 __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 54

12 FrontBoardServices 0x0361b1cb -[FBSSerialQueue _performNext] + 184

13 FrontBoardServices 0x0361b602 -[FBSSerialQueue _performNextFromRunLoopSource] + 52

14 FrontBoardServices 0x0361a8fe FBSSerialQueueRunLoopSourceHandler + 33

15 CoreFoundation 0x009ae7af __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15

16 CoreFoundation 0x009a443b __CFRunLoopDoSources0 + 523

17 CoreFoundation 0x009a3858 __CFRunLoopRun + 1032

18 CoreFoundation 0x009a3196 CFRunLoopRunSpecific + 470

19 CoreFoundation 0x009a2fab CFRunLoopRunInMode + 123

20 UIKit 0x00e1ef8f -[UIApplication _run] + 540

21 UIKit 0x00e24724 UIApplicationMain + 160

22 Kapitel2 0x00081a7a main + 138

23 libdyld.dylib 0x02fd1a21 start + 1

24 ??? 0x00000001 0x0 + 1

)

libc++abi.dylib: terminating with uncaught exception of type NSException

(lldb)

This is what I was looking for. Thanks! 🙂


Okay, so look at the very first part of the log:

2015-08-22 08:05:41.219 Kapitel2[681:18681] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: …


This is the reason for both the exception and the crash: the system is entirely unable to load your nib. And because you can't have an app without an interface, the exeption was considered significant enough that it's better to just crash.


So, have you recently changed the name of your nib file to something other than "Main"? Or are you trying to use a storyboard? How recently has the problem appeared?

Okay, I don't changed the name from the "main" file. Yes, I use a storyboard.

At first I was start the app and its starts, then I tipp the Button and crash.

Then after this start I tried it again and the app doesn't start, start and crash.

Accepted Answer

I think I've figured it out: you said you use a storyboard, but your app is trying to load a nib. That's why it's getting so confused. What you need to do is tell your app that it's supposed to look for a storyboard, not a nib. Here's how:


• Select your project file in the Project Navigator

• In the sidebar with "Projects" and "Targets," select your app under "Targets"

• Click the Info tab

• Expand "Custom iOS target properties" if necessary

• Look for something like "Main nib file base name." If you see it, click it and change it to "Main storyboard file base name."

• Make sure the name to the right matches the name of your storyboard file

• Now build and run.


Hopefully this will clear up the problem. 😉


To recap, an app crashes with the SIGABRT error whenever an exception (a fatal error) is raised and no recovery is possible, such as during the start-up sequence, where any problem is critical.

I have do this.


If I take the name from my storyboard and run the app, crash and sgabrt.

If I take the name Main, I becoes this error:


2015-08-22 09:47:35.911 Kapitel2[1168:47555] [+] <ViewController: 0x7ba78de0>.writeLog:

(lldb)

So whats now?

Could you post the contents of your Info.plist file? I think something is still wrong.

No, I can't copy it, I try it again with a picture.

Hmmm.


Can you open this file?


file:///Users/Paul/Pictures/Snip20150822_1.png

That file is on your Mac—I can't open it. Find your property list in the Project navigator, then right-click it and select Open As > Source Code. Then you'll be able to copy and paste it here.

Okay, here:



<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-/

<plist version="1.0">

<dict>

<key>CFBundleDevelopmentRegion</key>

<string>en</string>

<key>CFBundleExecutable</key>

<string>$(EXECUTABLE_NAME)</string>

<key>CFBundleIdentifier</key>

<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>

<key>CFBundleInfoDictionaryVersion</key>

<string>6.0</string>

<key>CFBundleName</key>

<string>$(PRODUCT_NAME)</string>

<key>CFBundlePackageType</key>

<string>APPL</string>

<key>CFBundleShortVersionString</key>

<string>1.0</string>

<key>CFBundleSignature</key>

<string>????</string>

<key>CFBundleVersion</key>

<string>1</string>

<key>LSRequiresIPhoneOS</key>

<true/>

<key>UILaunchStoryboardName</key>

<string>LaunchScreen</string>

<key>UIMainStoryboardFile</key>

<string>Main.storyboard</string>

<key>UIRequiredDeviceCapabilities</key>

<array>

<string>armv7</string>

</array>

<key>UISupportedInterfaceOrientations</key>

<array>

<string>UIInterfaceOrientationPortrait</string>

<string>UIInterfaceOrientationLandscapeLeft</string>

<string>UIInterfaceOrientationLandscapeRight</string>

</array>

</dict>

</plist>

Remove the file extension from the storyboard name.

Okay, when I start the app now, I become a black screen in the simulator.

The simulator takes quite a while to warm up, so your app should show up eventually. But it runs now, right? That's a step in the right direction…

how do i fix the sigabrt error?
 
 
Q