Xcode error on running app with embedded framework - ios

I am trying to create framework of my existing app which can be added to any other app as a module. In previous version of the app, i don't have any issues creating the framework and adding it to a demo app to test if it works. With newer version of the app, i am having an issue:
2017-04-21 13:59:02.238333-0400 XXX[8320:3762763] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(0x1868c2fd8 0x185324538 0x1867a4888 0x1010c3948 0x18c9f1f9c 0x18ca09a28 0x18cb8e2a0 0x18caa8c4c 0x18caa88b4 0x18caa8818 0x18c9ef158 0x189bdf274 0x189bd3de8 0x189bd3ca8 0x189b4f360 0x189b763c0 0x189b76e8c 0x1868709a0 0x18686e628 0x18686ea74 0x18679ed94 0x188208074 0x18ca57130 0x100084860 0x1857ad59c)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any suggestions how to trace back the error inside the embedded framework?
It is happening only with the main View Controllers of the app, not on any off the second level View Controllers which are accessed from these main View Controllers.
I went through the code of the old version and the new version of the embedded framework, i don't see anything major to be different, checked Line by Line the whole code.
Any suggestions?

Thank you codealchimist for the solution, i figure out what i was missing in order to be able to debug it. The solution provided by him solves the problem to be able to debug the app & framework.

Related

How to identify crash from XIB

I don't have any code implemented in view controller to set the font or attributedLabel. But I'm seeing crash with below reason.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: -[_SwiftValue pointSize]: unrecognized selector sent to instance 0x610001040ba0
There is another way of debugging issue. When app is crashed, check left panel and you will observe threads stack. In that find out Obj_exception_throw select that and use your logging area to run command po $arg1. This may give you the correct reason for crashing.
Or else, you can try using Application Unit tests for verifying all your IBOutlets and objects, loaded from NIBs.
You can select that xib and open it as source code.
Or search tho whole project to find that.

There doesn't seem to be a valid compiled storyboard at path in xcode 7.3 on ios9.3

I'm writing application(iPad only app) for iPad(running iOS 9.3.3) its working well, but sometimes it get crashed by throwing,
2016-10-18 16:09:14.129 appName[239:23575] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'There doesn't seem to be a valid compiled storyboard at path '/var/containers/Bundle/Application/78FAE276-6B37-4A64-AB82-21F171D8E383/appName.app/PDSuperStory.storyboardc''
*** First throw call stack:
(0x2149f91b 0x20c3ae17 0x2611ff71 0x84a88 0x13ef90 0xa6150 0x10c4dc 0x145a58 0xbd1b7f 0xbd1b6b 0xbd6655 0x21461b6d 0x21460067 0x213af229 0x213af015 0x2299fac9 0x25a83189 0x111698 0x21057873)
libc++abi.dylib: terminating with uncaught exception of type NSException
Before this crash everything works fine no memory leaks showing in Instruments either. No solution working out after cleaning the project or re-installing application on device.
Any solution guys?
I was getting the same error till I just did Product>Clean Build Folder and now it seems all good.

iOS 10 Beta SDK - [UIDeviceRGBColor countByEnumeratingWithState:objects:count:]: unrecognized selector

When our iOS application is compiled on iOS 10 Developer Preview SDK, when launching one of the first view controllers of the application, the application crashes with this exception :
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIDeviceRGBColor countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x17adb5a0'
*** First throw call stack:
(0x23c9b91b 0x23436e17 0x24474da3 0x24474f5f 0x24447e81 0x24446f25 0x286c8a0b 0x2857baa3 0x2834effb 0x28214a1f 0x28214971 0x28aa9ec1 0x28560d01 0x285846e5 0x28586d65 0x28223541 0x28586ca9 0x28586f91 0x2830ddb9 0x28586fcf 0x1c13b3 0x1beb89 0x1bf927 0x244c6655 0x23c5e58f 0x23c5e1c1 0x23c5c00d 0x23bab229 0x23bab015 0x2519bac9 0x2827d189 0xe3b65 0x23853873)
libc++abi.dylib: terminating with uncaught exception of type NSException
In the code of our application, this selector of UIDeviceRGBColor is never called.
Does someone have the same problem ? Is it a bug of iOS 10 Beta ?
When compiled with iOS 10 Beta SDK, the problem occurs as well on devices running on iOS 10 Beta as on iOS 9.
The problem does not appear (not on iOS 10, not on iOS 9) when the application is compiled with iOS 9 SDK
Thank you.
Best regards.
In case your are using interface files like Xib and Nib for your views, refer to my answer in this question
Quoted from that question:
When I try to compile and run my project with the same configuration (XCode 8 beta 6, iOS 10 SDK), I encountered a similar issue, except that my error message was:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIDeviceRGBColor length]: unrecognized selector sent to instance 0x600000479280'
And I noticed that this issue only occurs when the view is init by using interface files, i.e. Xib and Nib. I solved this issue by:
Open your interface file, in the right panel, navigate to the File Inspector tab.
Change the attribute highlighted to "iOS 7.0 and Later" (or whatever iOS version later)
Then compile and run your project again, this should fix your issue, though I am not sure about the reason behind this.

iOS crash 'failed to generate newParagraphStyle'

After I add a library (a internal common library) to my project I received the following crash:
*** Assertion failure in -[_UICascadingTextStorage setTextAlignment:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3505.16/TextSystem/_UICascadingTextStorage.m:270
Project[784:18448] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'failed to generate newParagraphStyle'
I can't find what are the reasons for the type of crash or what I did wrong for this.
Note: I added the Libray but I haven't yet used any features from library.
Can anyone help me?
The library may call +initialize or +load or do some general swizzling/overriding of Apple classes and it can mess something up, e.g. in a new iOS version, if APIs changed.
If you have the src for the library, look for those things.
Also create an exception breakpoint, maybe it will point you to the problem in code.

I accidentally deleted View Controller

I accidentally deleted View Controller in Main.Storyboard and now I am trying to build and run my game and it says build "Sussess" but it builds Lanch Image Appears and then the screen is white and nothing happens please help me. My game is in appStore already I cant remake it!!!! What should I do?
I have this in debug area!
2014-09-15 02:51:02.680 Greenchick[4300:60b] -[UIView setShowsFPS:]: unrecognized selector sent to instance 0xb599f50
2014-09-15 02:51:02.692 Greenchick[4300:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setShowsFPS:]: unrecognized selector sent to instance 0xb599f50'
*** First throw call stack:
I think usually, the file gets deleted from the project but is usually present in the project folder. Check if your view controller is present in the Project folder. If it is present, you can add to your project again.

Resources