Error when running app from Xcode Version 8.3.3 (8E3004b) - ios

When running the app from Xcode Version 9.0 beta 4 (9M189t), everything works fine. But when I run the same code on Xcode Version 8.3.3 (8E3004b), the app crashes with this message:
PagerTabViewController in Interface Builder file.
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x12e51aac0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key leftBarButtonItem.'
On interface builder I can see that 'leftBarButtonItem' is correctly linked with the button.
The connection inspector shows this:
It doesn't show problem on 'leftBarButtonItem', but yes it shows problems for 'buttonBarView' and 'containerView'.
These two items are from pod XLPagerTabStrip. These two items must be connected in interface builder in order to work. I don't know if my problem is related with this pod, but it's weird these connections shows problems. As I said, on Xcode 9.0 it shows correctly and runs without errors. I tried to disconnect these two views and connect again, but when I do it the interface builder don't let me connect it again.
I'm completely lost with this problem. I need to use Xcode 8.3.3 in order to upload a binary to App Store.
Xcode 9.0 uses Swift 4 as compiler while Xcode 8.3.3 uses Swift 3.1. I also don't know if this is the problem.
Any idea about what is happening? Thanks

Related

Could not find module 'IQKeyboardManagerSwift' for target 'armv7-apple-ios';

I'm getting this crash at a few places through my app which seems to be triggered by IQKeyboardManagerSwift. I get this error in my AppDelegate.swift file on line 10 which is just
`import IQKeyboardManagerSwift. It was all working fine before I updated to the latest version of Swift, howver all my dependencies are up to date. Including IQKeyboardManagerSwift. Has anyone seen a message like this before?
Could not find module 'IQKeyboardManagerSwift' for target
'armv7-apple-ios'; found: arm64, arm64-apple-ios
In the console I also get this message.
Terminating app due to uncaught exception
'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate
class named _UITextLayoutView because no class named _UITextLayoutView
was found; the class needs to be defined in source code or linked in
from a library (ensure the class is part of the correct target)'
This is a known bug in Xcode 11.2
See:
After upgrading to Xcode 11.2 from Xcode 11.1, app crashes due to _UITextLayoutView
You can either download an older Xcode version from here: https://developer.apple.com/download/more/
or upgrade to the newly released 11.2.1 (I haven't tried that one yet)

App began to crash on iOS 9.1 Beta 2

The application began to crash when installing on iOS 9.1 Beta 2. Exactly same binary (downloaded from hudson link) behaves so:
It did not crash on iOS 9.0 and iOS 9.0.1
It did not crash on either iOS 8
I have extracted the crash log, crash happens inside the call to [[NSBundle mainBundle] loadNibNamed:#"NameOfView" owner:self options:nil];. The crash itself is NSUnknownKeyException:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[< NameOfView: 0x1446a6ea0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key .'
So far i see weird key '.' which nib loading mechanism tries to set on my class, and obviously, such is not present in nib. And this looks extraweird even more, due to iOS 9.1 beta 2 is the only version with this behaviour. Moreover, building app with XCode 7 from on same git revision gives no success crashing app - it works as expected. Has anybody experienced such behaviour after trying your release versions on iOS 9.0.1 beta 2? Want to have some feedbacks of SO community before file a bug to radar. Appreciate your help, guys.
P.S. I'd like to emphasize that the issue reproduces only on that particular binary. Building it again from the same sources in XCode 7 doesn't produce a crash. So please, don't suggest how to debug such kind of problem, how to set exception breakpoint etc.
EDIT
Since 9.1 release, it's no more reproducible.
As stated in comment to original question, there's no solution and no response on bug yet.
The openradar link: http://openradar.appspot.com/radar?id=6294934587965440
I'll be posting an updates here after the 9.1 release.
There are some empiric ways to come up with solution:
Override KVC setter setValue:forKey: and forbid empty string
key.
Use always the latest stable SDK to build.
But again, no actual response from Apple neither.
EDIT Since 9.1 release, it's no more reproducible.

Application working fine in iOS 8 device but crashing in iOS 7 devices

I have developed application using Xcode 6 which is using auto layout and size classes . It is working fine in iOS 8 devices but there is problem while running application on iOS 7 devices. In one view controller the application is crashing with the following exception :
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIView 0x7916a9c0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key keyPath.'
I have checked all the connection in connection inspector ,those all are clean. Please suggest some solution to overcome this problem .
This is normally related to a deleted IBOutlet. Check your Storyboard/Nibs outlets and see if there anything marked with an "!": it means the corresponding outlet was removed.

Today Extension Crashes before launching on iOS 8.1.2

I've been making a today extension that downloads articles from a feed and display the latest ones.
The whole thing worked fine on iOS 8, still worked on iOS 8.1, then came iOS 8.1.2 and we started having complaints about the today extension not working anymore.
I tried debugging on iOS 8.1.2 devices, and before the extension even launch, it crashes with this error :
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: <__NSConcreteUUID 0x174027280> 5AFB07AB-5DCD-46FE-8D07-44DE0F3789F2)'
I have read this post about frequent bugs happening when developing a today extension : http://www.atomicbird.com/blog/ios-app-extension-tip
In his post, Tom Harrington says :
In iOS 8 (and other recent versions), enabling modules in Xcode's build settings means you don't need to explicitly list all the frameworks you want to use. They'll be found automatically.
But this isn't the case with NotificationCenter.framework, which Today extensions use. If you remove that from the build settings, you won't get any build warnings or errors. But when you try to load the extension, you'll get an exception from libextension.dylib and your extension won't load. The exception message is not enlightening:
2014-08-16 12:06:53.793 TodayTestExtension[41313:6111763] * Terminating
app due to uncaught exception 'NSInvalidArgumentException', reason: '*
setObjectForKey: object cannot be nil (key: <__NSConcreteUUID
0x7fd729422390> ED3B42F8-66CD-4CB0-BCD5-F3DBA6F34DB5)'
If you're doing a today extension, just leave that framework in the build settings. It shouldn't need to be there, but it does.
My extension does include NotificationCenter.framework in its build settings, but I suspect my problem might be similar in some way.
Anyone faced a similar problem? Any idea how to solve it?
This error also occurs if you use NSExtensionPrincipalClass inside "Info.plist" in order to define a base class (instead of using a storyboard) with the name of a ViewController which does not exist.
When using Swift, make sure to prefix the class with the module name (usually the name of the target) like "Module.MyViewController".
Eventually I tried to remove NotificationCenter.framework from my target and put it back, cleaned the project, and it's now working again. I guess the framework wasn't properly linked after all, though I could see it on my target with xcode. Also, I can't figure out why it did work, then stopped working with the arrival of 8.1.2.
I fixed this issue by adding the #objc attribute to the Swift class.
#objc(NotificationViewController)
class NotificationViewController: UIViewController, UNNotificationContentExtension {
...
}
Just experienced the same issue. For me, it was "Main Interface" property in "General settings" of the Keyboard target. It was blank, and i set it to my storyboard file and now it works like a charm.

How to add momd(managed object model) into ios framework?

I am trying to convert my ios app(XYZ) into framework(XYZ.framework) so that it can be included in other ios applications. Went through below links and able to develop a framework.
LINK1:LINK1
LINK2:LINK2
But when i include my framework in other apps and try to compile for first time , xcode is throwing error "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'executeFetchRequest:error: A fetch request must have an entity.". I followed below steps and get rid of this error.
STEP1: Added XYZ.framework in other app and compiled for first time, but xcode gave error mentioned above.
STEP2: Added XYZ.momd(by drag and drop) along with XYZ.framework in other application. Compiled it and Xcode didn't throw any error.
STEP3: Removed XYZ.momd from other application and compiled it. Xcode didn't throw any error!!!!
Should i give XYZ.momd along with XYZ.framework while distributing XYZ.framework, so that XYZ.momd can be included in other applications? I googled, but didn't get how to add momd inside framework and include it in other applications.

Resources