Could not find module 'IQKeyboardManagerSwift' for target 'armv7-apple-ios'; - 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)

Related

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

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

How to fix sqlite3 libversion mismatch

I just updated to the latest Xcode, version 6.2 and started seeing this error when running my app.
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: sqlite3 libversion mismatch: headers report 3007013, but library reports 3008005
The error shows up running in the simulator using iOS 8.2, but works fine in iOS 8.1. My app includes libsqlite3.dylib from Apple.
Any suggestions on the cause or how to resolve?
Looks like an issue with MapboxGL and ios 8.2 as described here:
https://github.com/mapbox/mapbox-gl-native/issues/968
This looks like the version check in question:
https://github.com/mapbox/mapbox-gl-native/blob/b56b618abf0b15025b61ab96dcc873cf7af82450/platform/default/sqlite3.cpp

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.

Urban Airship crashes when calling takeoff

Upgrading to UrbanAirship 3.0.0 with Xcode 5.0, I'm getting an error when calling this code:
[UAirship takeOff:config];
The error is
+[NSJSONSerialization stringWithObject:]: unrecognized selector sent to class 0x3b2ca9fc
2013-09-19 15:02:31.981 [178:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSJSONSerialization stringWithObject:]: unrecognized selector sent to class 0x3b2ca9fc'
This doesn't seem to appear when setting the key "inProduction" to "YES" in the AirshipConfig.plist, which makes sense as calling takeOff: populates the instance of UAirShip.
It seems to be due to the category NSJSONSerialization+UAAdditions.
Any help on this one?
Thanks
To fix this issue, you must include "-ObjC" flag in "Other Linker Flags" found in your projects build settings.
UAirship library 3.x now makes use of Objective-C categories so this flag must be set to avoid the runtime exception.
Details on the issue can be found here:
https://developer.apple.com/library/mac/qa/qa1490/_index.html
Updated the docs:
http://docs.urbanairship.com/build/ios.html#build-settings
http://docs.urbanairship.com/topic_guides/ios_migration.html#linker-flags
Doesn't seam to be happening with the source: https://github.com/urbanairship/ios-library
You must have included both the libraries:
libUAirship-3.0.0.a
libUAirship-iOS5-3.0.0.a
You have to use either of the library for respective iOS
After looking at different solutions, it turns out that this fixes the issue:
• Download sources from https://github.com/urbanairship/ios-library directly into your App folder (don't take .zip given on their website)
• Drag & drop the Airship folder in your Project (do not use the AirshipLib one)
• Don't link any of the libUAirship-3.0.0.a or libUAirship-iOS5-3.0.0.a
• Boom. It's working.
Hope it'll help some others out there looking to fix this for ages.
Just to add, my problem was that I added -ObjC flag to the project, and it should be added to the target settings.
Also, if that does not compile, there is another option
-Wl,-force_load,<PathToYourLib>/libUAirship-4.0.0.a
Also should be added to the target. Fill the real path to your lib instead of <PathToYourLib>.

Resources