question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

version 6.5.2 works,but version 9.2.4 crash with uncaught exception 'NSUnknownKeyException', reason: '[<RCTView 0x7fbd7aecf380> valueForUndefinedKey:]: this class is not key value coding-compliant for the key active.'

See original GitHub issue
2019-03-02 09:49:39.764385+0800 MoonFM[37390:6532468] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<RCTView 0x7fbd7aecf380> valueForUndefinedKey:]: this class is not key value coding-compliant for the key active.'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000010af0e1bb __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x000000010dc0b735 objc_exception_throw + 48
	2   CoreFoundation                      0x000000010af0dd29 -[NSException raise] + 9
	3   Foundation                          0x000000010b3a7cd9 -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 226
	4   Foundation                          0x000000010b3a6b21 -[NSObject(NSKeyValueCoding) valueForKey:] + 284
	5   Foundation                          0x000000010b496f63 -[NSFunctionExpression expressionValueWithObject:context:] + 807
	6   Foundation                          0x000000010b48defe -[NSComparisonPredicate evaluateWithObject:substitutionVariables:] + 239
	7   Foundation                          0x000000010b49012c _filterObjectsUsingPredicate + 380
	8   Foundation                          0x000000010b48ff26 -[NSArray(NSPredicateSupport) filteredArrayUsingPredicate:] + 278
	9   MoonFM                              0x0000000107f1ac37 -[RNSVGGroup hitTest:withEvent:] + 1367
	10  MoonFM                              0x0000000107f3f41d -[RNSVGSvgView hitTest:withEvent:] + 797
	11  MoonFM                              0x0000000107bf79d4 -[UIView(React) reactTagAtPoint:] + 68
	12  MoonFM                              0x0000000107c05237 -[RCTTouchHandler _recordNewTouches:] + 1031
	13  MoonFM                              0x0000000107c06c7d -[RCTTouchHandler touchesBegan:withEvent:] + 157
	14  UIKitCore                           0x000000011974c5d5 -[UIGestureRecognizer _touchesBegan:withEvent:] + 240
	15  UIKitCore                           0x0000000119c4cd0c -[UITouchesEvent _sendEventToGestureRecognizer:] + 287
	16  UIKitCore                           0x0000000119740798 __47-[UIGestureEnvironment _updateForEvent:window:]_block_invoke + 64
	17  UIKitCore                           0x00000001197408e3 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 276
	18  UIKitCore                           0x000000011974071d -[UIGestureEnvironment _updateForEvent:window:] + 200
	19  UIKitCore                           0x0000000119bb078a -[UIWindow sendEvent:] + 4058
	20  UIKitCore                           0x0000000119b8e394 -[UIApplication sendEvent:] + 352
	21  UIKitCore                           0x0000000119c635a9 __dispatchPreprocessedEventFromEventQueue + 3054
	22  UIKitCore                           0x0000000119c661cb __handleEventQueueInternal + 5948
	23  CoreFoundation                      0x000000010ae73721 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
	24  CoreFoundation                      0x000000010ae72f93 __CFRunLoopDoSources0 + 243
	25  CoreFoundation                      0x000000010ae6d63f __CFRunLoopRun + 1263
	26  CoreFoundation                      0x000000010ae6ce11 CFRunLoopRunSpecific + 625
	27  GraphicsServices                    0x00000001140be1dd GSEventRunModal + 62
	28  UIKitCore                           0x0000000119b7281d UIApplicationMain + 140
	29  MoonFM                              0x000000010597e1e4 main + 132
	30  libdyld.dylib                       0x00000001121d8575 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
msandcommented, Mar 16, 2019

@j-wang Can you try the fix from here: https://github.com/react-native-community/react-native-svg/commit/ec9637bcc5b43633eaa3413c99001ac4da946104

--- ios/Elements/RNSVGGroup.m	(revision cdf862ba73b0e17e574bfc25970f6363915128d2)
+++ ios/Elements/RNSVGGroup.m	(revision ec9637bcc5b43633eaa3413c99001ac4da946104)
@@ -174,7 +174,7 @@
     }
 
     if (!event) {
-        NSPredicate *const anyActive = [NSPredicate predicateWithFormat:@"active == TRUE"];
+        NSPredicate *const anyActive = [NSPredicate predicateWithFormat:@"self isKindOfClass: %@ AND active == TRUE", [RNSVGNode class]];
         NSArray *const filtered = [self.subviews filteredArrayUsingPredicate:anyActive];
         if ([filtered count] != 0) {
             return [filtered.lastObject hitTest:transformed withEvent:event];

0reactions
msandcommented, Mar 16, 2019

Great! Well, then it certainly seems like you have non svg elements inside some svg element, otherwise this shouldn’t be possible. Perhaps I should add some warnings in dev mode, giving some indication of what and where it is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

version 6.5.2 works,but version 9.2.4 crash with uncaught ...
... Terminating app due to uncaught exception 'NSUnknownKeyException', reason: ... this class is not key value coding-compliant for the ...
Read more >
why it says "this class is not key value coding-compliant for the ...
One of the frequent reasons for such a crash is that you miss a connection to an IBOutlet from the storyboard, or that...
Read more >
How to fix 'NSUnknownKeyException', reason: … this class is ...
This gives the following error: Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key ...
Read more >
Fixing "This Class is not Key Value Coding-Compliant for the ...
If we run the app it will crash due to uncaught exception 'NSUnknownKeyException' which this is a very common error in Xcode. In...
Read more >
How to fix 'NSUnknownKeyException', reason: … this class is ...
this class is not key value coding-compliant for the key X” error? The most common solution is double-checking the outlets. But if that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found