1

I'm having an issue with my xCode project, for unknown reason it started crashing when dismissing or hiding the keyboard once you have finished typing. This didn't happen before the new xCode 8 update, Im hoping someone could help me here.

This is the error code

2016-10-07 10:30:13.658061 Stormpath Notes[353:85164] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2016-10-07 10:30:13.659786 Stormpath Notes[353:85164] [MC] Reading from public effective user settings.
2016-10-07 10:30:15.840368 Stormpath Notes[353:85188] 0x17014a030 Copy matching assets reply: XPC_TYPE_DICTIONARY  <dictionary: 0x17014a030> { count = 1, transaction: 0, voucher = 0x0, contents =
    "Result" => <int64: 0x17003e360>: 29
}
2016-10-07 10:30:15.848842 Stormpath Notes[353:85188] 0x17014c8c0 Daemon configuration query reply: XPC_TYPE_DICTIONARY  <dictionary: 0x17014c8c0> { count = 2, transaction: 0, voucher = 0x0, contents =
    "Dictionary" => <dictionary: 0x17014c550> { count = 1, transaction: 0, voucher = 0x0, contents =
        "ServerURL" => <dictionary: 0x17014cc30> { count = 3, transaction: 0, voucher = 0x0, contents =
            "com.apple.CFURL.magic" => <uuid: 0x17024d020> C3853DCC-9776-4114-B6C1-FD9F51944A6D
            "com.apple.CFURL.string" => <string: 0x17024fab0> { length = 30, contents = "https://mesu.apple.com/assets/" }
            "com.apple.CFURL.base" => <null: 0x1ada4fe80>: null-object
        }
    }
    "Result" => <int64: 0x17003db60>: 0
}
2016-10-07 10:30:15.849389 Stormpath Notes[353:85188] [MobileAssetError:29] Unable to copy asset information from https://mesu.apple.com/assets/ for asset type com.apple.MobileAsset.TextInput.SpellChecker
2016-10-07 10:30:19.636313 Stormpath Notes[353:85188] 0x17014c600 Copy matching assets reply: XPC_TYPE_DICTIONARY  <dictionary: 0x17014c600> { count = 2, transaction: 0, voucher = 0x0, contents =
    "Assets" => <data: 0x170073540>: { length = 4379 bytes, contents = 0x62706c6973743030d4000100020003000400050006019001... }
    "Result" => <int64: 0x170037ba0>: 0
}
2016-10-07 10:30:19.648546 Stormpath Notes[353:85188] 0x17414abe0 Copy assets attributes reply: XPC_TYPE_DICTIONARY  <dictionary: 0x17414abe0> { count = 2, transaction: 0, voucher = 0x0, contents =
    "Attributes" => <data: 0x1744651c0>: { length = 302 bytes, contents = 0x62706c6973743030d40102030405061a1b58247665727369... }
    "Result" => <int64: 0x1740376c0>: 0
}
2016-10-07 10:30:19.652192 Stormpath Notes[353:85188] 0x17014c760 Copy assets attributes reply: XPC_TYPE_DICTIONARY  <dictionary: 0x17014c760> { count = 3, transaction: 0, voucher = 0x0, contents =
    "Attributes" => <data: 0x17047d340>: { length = 515 bytes, contents = 0x62706c6973743030d4010203040506232458247665727369... }
    "Result" => <int64: 0x17003e9c0>: 0
    "SandboxExtension" => <string: 0x170256620> { length = 258, contents = "c2ce16136725e2c509a70d9c78cb9c2d8098838e;00000000;00000000;0000000000000015;com.apple.assets.read;00000001;01000003;00000000002c3217;/private/var/MobileAsset/Assets/com_apple_MobileAsset_LinguisticData/12124144ce3f42648e61a6a8064d2fb9b2d42605.asset/AssetData" }
}
2016-10-07 10:30:19.655563 Stormpath Notes[353:85188] 0x17414a240 Copy assets attributes reply: XPC_TYPE_DICTIONARY  <dictionary: 0x17414a240> { count = 2, transaction: 0, voucher = 0x0, contents =
    "Attributes" => <data: 0x174465c00>: { length = 302 bytes, contents = 0x62706c6973743030d40102030405061a1b58247665727369... }
    "Result" => <int64: 0x174037460>: 0
}
2016-10-07 10:30:19.659475 Stormpath Notes[353:85188] 0x17414ad40 Copy assets attributes reply: XPC_TYPE_DICTIONARY  <dictionary: 0x17414ad40> { count = 3, transaction: 0, voucher = 0x0, contents =
    "Attributes" => <data: 0x174464c80>: { length = 515 bytes, contents = 0x62706c6973743030d4010203040506232458247665727369... }
    "Result" => <int64: 0x174026c20>: 0
    "SandboxExtension" => <string: 0x17425d5b0> { length = 258, contents = "34106c8c1a75ddc17eab9f02e36f839c9ec6d2f8;00000000;00000000;0000000000000015;com.apple.assets.read;00000001;01000003;00000000002c321a;/private/var/MobileAsset/Assets/com_apple_MobileAsset_LinguisticData/2e428a59a8c74acf82b249f73fcbbc785b892f69.asset/AssetData" }
}
2016-10-07 10:30:39.089880 Stormpath Notes[353:85164] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid type in JSON write (_SwiftValue)'
*** First throw call stack:
(0x18f52c1c0 0x18df6455c 0x18f52c108 0x190099620 0x19009b778 0x18f529220 0x19009af04 0x1900994ec 0x19009931c 0x19009a360 0x1000ffbb4 0x100100444 0x19541a1a4 0x19579c4c8 0x1955353e4 0x195534828 0x1955285f8 0x1957a8bb4 0x195398598 0x1957a8868 0x1953a2b44 0x19539dd8c 0x19536e858 0x195b5bcb8 0x195b55720 0x18f4da278 0x18f4d9bc0 0x18f4d77c0 0x18f406048 0x190e89198 0x1953d9628 0x1953d4360 0x100107590 0x18e3e85b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

If anyone could shed some light as to why this is happening would be much appreciated.

Sebbie
  • 81
  • 1
  • 11
  • I don't think it's related to keyboard, is there something else executed after? – Injectios Oct 07 '16 at 09:45
  • Theres nothing else executed really, all that it does is saves note when you click the save button. However you don't get the chance to click the save button. You click the text field and type anything you want and then dismiss the keyboard by clicking the bottom right button. When you do this the app crashes, but I don't see why this is happening. Quite confused – Sebbie Oct 07 '16 at 09:48
  • some operations with json? This is what your error says - Invalid type in JSON write (_SwiftValue) – Injectios Oct 07 '16 at 09:50
  • Honestly, I'm not a pro coder so I don't understand why its stating that theres an error with JSON as the code worked fine before I updated to xCode 8. I do get another error in *AppDelegate.swift* - It highlights this line of code *class AppDelegate: UIResponder, UIApplicationDelegate {* no idea why. It states a *Thread:1 signal SIGABRT* – Sebbie Oct 07 '16 at 09:52
  • update issue with "save to note" code, did you set on "exceptional brakepoint"? where it stops? – Injectios Oct 07 '16 at 09:54
  • Sorry I'm slightly confused at this point xD, still pretty new to app coding, would it be easier for me to upload this project on GitHub for you to check? – Sebbie Oct 07 '16 at 09:58
  • well, you can if it's difficult for you to fix and allowed to be published actually – Injectios Oct 07 '16 at 10:00
  • Sorry I can't run it since I still have xCode 7 – Injectios Oct 07 '16 at 10:09
  • Ahh so lucky xD - why did I update! – Sebbie Oct 07 '16 at 10:10
  • Just go to brakepoint tab and add "swift error, exception brakepoint" – Injectios Oct 07 '16 at 10:12

4 Answers4

1

The error is Invalid type in JSON write (_SwiftValue), which means it cannot serialize your object in JSON. This happen when the kind of data you set in the object to serialize is not supported by JSON, and so the serializer fails.

Take a look at the Apple documentation here, to see the accepted kinds of class.

Matteo Gobbi
  • 17,697
  • 3
  • 27
  • 41
0

This can be the cause of crash

2016-10-07 10:30:39.089880 Stormpath Notes[353:85164] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid type in JSON write (_SwiftValue)'
*** First throw call stack:
(0x18f52c1c0 0x18df6455c 0x18f52c108 0x190099620 0x19009b778 0x18f529220 0x19009af04 0x1900994ec 0x19009931c 0x19009a360 0x1000ffbb4 0x100100444 0x19541a1a4 0x19579c4c8 0x1955353e4 0x195534828 0x1955285f8 0x1957a8bb4 0x195398598 0x1957a8868 0x1953a2b44 0x19539dd8c 0x19536e858 0x195b5bcb8 0x195b55720 0x18f4da278 0x18f4d9bc0 0x18f4d77c0 0x18f406048 0x190e89198 0x1953d9628 0x1953d4360 0x100107590 0x18e3e85b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
gurmandeep
  • 1,227
  • 1
  • 14
  • 30
0

Remove not referenced IBOutlets and IBAction for respective UIViewcontroller .

Select "View > Utilities > Show Connections Inspector"

In my case this exception solved using above solution.

KKRocks
  • 8,222
  • 1
  • 18
  • 84
0

Hope it Help Full.

Its worked out for me gorgeous. Change your object attributes as like,

textView.autocorrectionType = UITextAutocorrectionTypeNo;
textView.spellCheckingType = UITextSpellCheckingTypeNo;

to know about it Click here.

Community
  • 1
  • 1
ssowri1
  • 1,299
  • 2
  • 14
  • 31