Android Studio 2.0+ crashes on OS X - android-studio-2.0

i haven't been able to run any version of Android Studio 2.x. it crashes seemingly randomly with this same exception after < 1min of simply navigating through files in a project:
Exception Name: JavaNativeException
Description: java.lang.NullPointerException
at sun.lwawt.macosx.CAccessibility.getAccessibleIndexInParent(CAccessibility.java:287)
User Info: (null)
0 CoreFoundation 0x00007fff94a9e4f2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff88d51f7e objc_exception_throw + 48
2 CoreFoundation 0x00007fff94a9e439 -[NSException raise] + 9
3 JavaNativeFoundation 0x000000011be9251f JNFCallStaticIntMethod + 236
4 libawt_lwawt.dylib 0x000000011d7c8deb +[JavaComponentAccessibility createWithAccessible:withEnv:withView:] + 76
5 libawt_lwawt.dylib 0x000000011d7c930b -[JavaComponentAccessibility accessibilityFocusedUIElement] + 194
6 libawt_lwawt.dylib 0x000000011d79e4f6 -[AWTView accessibilityFocusedUIElement] + 156
7 AppKit 0x00007fff98c44d37 -[NSWindow(NSWindowAccessibility) accessibilityFocusedUIElement] + 118
8 libawt_lwawt.dylib 0x000000011d7c9069 +[JavaComponentAccessibility postFocusChanged:] + 96
9 Foundation 0x00007fff9427af5e __NSThreadPerformPerform + 279
10 CoreFoundation 0x00007fff94a33881 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
11 CoreFoundation 0x00007fff94a12fbc __CFRunLoopDoSources0 + 556
12 CoreFoundation 0x00007fff94a124df __CFRunLoopRun + 927
13 CoreFoundation 0x00007fff94a11ed8 CFRunLoopRunSpecific + 296
14 HIToolbox 0x00007fff963fe935 RunCurrentEventLoopInMode + 235
15 HIToolbox 0x00007fff963fe76f ReceiveNextEventCommon + 432
16 HIToolbox 0x00007fff963fe5af _BlockUntilNextEventMatchingListInModeWithFilter + 71
17 AppKit 0x00007fff98463efa _DPSNextEvent + 1067
18 AppKit 0x00007fff9846332a -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
19 libosxapp.dylib 0x000000011d8503aa -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124
20 AppKit 0x00007fff98457e84 -[NSApplication run] + 682
21 libosxapp.dylib 0x000000011d85014d +[NSApplicationAWT runAWTLoopWithApp:] + 156
22 libawt_lwawt.dylib 0x000000011d7dd4b3 -[AWTStarter starter:] + 905
23 Foundation 0x00007fff9427af5e __NSThreadPerformPerform + 279
24 CoreFoundation 0x00007fff94a33881 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
25 CoreFoundation 0x00007fff94a12fbc __CFRunLoopDoSources0 + 556
26 CoreFoundation 0x00007fff94a124df __CFRunLoopRun + 927
27 CoreFoundation 0x00007fff94a11ed8 CFRunLoopRunSpecific + 296
28 studio 0x00000001000012f3 main + 357
29 studio 0x000000010000116c start + 52
30 ??? 0x0000000000000001 0x0 + 1
i'm running OS X 10.11.4 with Java version 1.8.0_92.
i'd seen some other references to this problem in the context of doing drag & drop operations, but the accepted solution of upgrading the JDK version doesn't seem to have resolved my issue.
FWIW i'm able to run Studio 1.5 without encountering this issue.

Answering a question of why it actually happens, but the source has this:
public static int getAccessibleIndexInParent(final Accessible a, final Component c) {
if (a == null) return 0;
return invokeAndWait(new Callable<Integer>() {
public Integer call() throws Exception {
final AccessibleContext ac = a.getAccessibleContext();
if (ac == null) return null;
return ac.getAccessibleIndexInParent();
}
}, c);
}
As you can see, the Callable returns null in some situations, which is fine for an Integer, but you get a NPE as soon as it unboxes that to return int. They probably should be checking for null and returning 0.

Related

Xcode 14 beta 5 cause crash on working app

We have been trying to run our app to prepare for iOS 16 but so far no luck. The app runs perfectly in Xcode 13. Also when we download the app from App Store to iOS 16 beta device, it works with no problem.
What we face with new Xcode 14 Beta 5 is the app runs till the first view controller then we get a weird error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application circumvented Objective-C runtime dealloc initiation for <UINavigationController> object.'
*** First throw call stack:
(
0 CoreFoundation 0x00007ff800427380 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff80004dbaf objc_exception_throw + 48
2 Foundation 0x00007ff800b876ac _userInfoForFileAndLine + 0
3 UIKitCore 0x0000000124447d4e -[UIViewController dealloc] + 1475
4 UIKitCore 0x0000000124359e30 -[UINavigationController dealloc] + 389
5 libobjc.A.dylib 0x00007ff80004b6a1 _ZN11objc_object17sidetable_releaseEbb + 203
6 libobjc.A.dylib 0x00007ff80004be64 _ZN19AutoreleasePoolPage12releaseUntilEPP11objc_object + 180
7 libobjc.A.dylib 0x00007ff80004bcad objc_autoreleasePoolPop + 203
8 UIKitCore 0x00000001252e54bf -[_UIAfterCACommitBlock run] + 80
9 UIKitCore 0x00000001252e59a4 -[_UIAfterCACommitQueue flush] + 190
10 UIKitCore 0x0000000124d40730 _runAfterCACommitDeferredBlocks + 782
11 UIKitCore 0x0000000124d2eede _cleanUpAfterCAFlushAndRunDeferredBlocks + 96
12 UIKitCore 0x0000000124d64abb _afterCACommitHandler + 72
13 CoreFoundation 0x00007ff800386015 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
14 CoreFoundation 0x00007ff800380982 __CFRunLoopDoObservers + 515
15 CoreFoundation 0x00007ff800380ecd __CFRunLoopRun + 1161
16 CoreFoundation 0x00007ff800380667 CFRunLoopRunSpecific + 560
17 GraphicsServices 0x00007ff809bfc28a GSEventRunModal + 139
18 UIKitCore 0x0000000124d30621 -[UIApplication _run] + 994
19 UIKitCore 0x0000000124d354fd UIApplicationMain + 123
20 xxxxxx 0x000000010e9aa830 main + 96
21 dyld 0x00000001136e52bf start_sim + 10
22 ??? 0x00000001148c751e 0x0 + 4639716638
)
OK, So I fixed my own problem. For me it was the code in the dependency file I was using in my pods. So, simply search for
+ (void)initialize {
}
which is most possibly causing the error.

EXC_BAD_ACCESS on application start

In my macOS application I have a very rare crash which I cannot reproduce and I can't find out what causes it.
Please see the call stack below.
Here are my thoughts:
It seems to happen on application start because there's NSPersistentUIRestorer in the call stack.
Then main window view (NSThemeFrame) changes its frame size and sends NSViewGeometryInWindowDidChangeNotification to the children.
Some button tries to setup mouse tracking with _setMouseTrackingForCell and crashes becase some subview (or superview?) is deallocated.
Right now I'm out of ideas and I would appreciate any advice or suggestion. Thank you in advance.
Call stack:
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00006080044e6820
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x7fff50eb4ea9 objc_msgSend + 41
1 AppKit 0x7fff272c62d5 -[NSView(NSInternal) _uninstallTrackingArea:] + 326
2 AppKit 0x7fff2726525e -[NSView removeTrackingArea:] + 312
3 AppKit 0x7fff2729d3c7 -[NSCell(NSPrivate_CellMouseTracking) _setMouseTrackingInRect:ofView:withConfiguration:] + 101
4 AppKit 0x7fff2729d2fe -[NSCell(NSPrivate_CellMouseTracking) _setMouseTrackingInRect:ofView:] + 90
5 AppKit 0x7fff2729d1bb -[NSButtonCell _setMouseTrackingInRect:ofView:] + 84
6 AppKit 0x7fff2729d15c -[NSControl _setMouseTrackingForCell:] + 102
7 AppKit 0x7fff2729d0af -[NSButton(NSButtonBorder) _setMouseTrackingForCell:] + 47
8 CoreFoundation 0x7fff29ca5edc __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
9 CoreFoundation 0x7fff29ca5daa _CFXRegistrationPost + 458
10 CoreFoundation 0x7fff29ca5ae1 ___CFXNotificationPost_block_invoke + 225
11 CoreFoundation 0x7fff29c63880 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1664
12 CoreFoundation 0x7fff29c629b7 _CFXNotificationPost + 599
13 Foundation 0x7fff2bd728c7 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
14 AppKit 0x7fff27ad9859 NSViewHierarchyNoteGeometryInWindowDidChange + 160
15 AppKit 0x7fff27ad9a3a NSViewHierarchyNoteGeometryInWindowDidChange + 641
16 AppKit 0x7fff27ad9a3a NSViewHierarchyNoteGeometryInWindowDidChange + 641
17 AppKit 0x7fff27ad9a3a NSViewHierarchyNoteGeometryInWindowDidChange + 641
18 AppKit 0x7fff27ad9a3a NSViewHierarchyNoteGeometryInWindowDidChange + 641
19 AppKit 0x7fff27ad9a3a NSViewHierarchyNoteGeometryInWindowDidChange + 641
20 AppKit 0x7fff2720e9a7 -[NSView _invalidateFocus] + 63
21 AppKit 0x7fff2724e7dc -[NSView setFrameSize:] + 1902
22 AppKit 0x7fff27264b1e -[NSView setFrame:] + 371
23 AppKit 0x7fff2726f49c -[NSThemeFrame _relayoutAuxiliaryViewsOfType:] + 163
24 AppKit 0x7fff2726f3e6 -[NSThemeFrame relayoutAuxiliaryViewsOfType:] + 27
25 AppKit 0x7fff2726ec33 -[NSTitlebarViewController insertChildViewController:atIndex:] + 386
26 AppKit 0x7fff27a88caa -[NSWindowStackController _makeTabBarForWindow:visible:] + 221
27 AppKit 0x7fff27a8bc77 -[NSWindowStackController _addSyncedTabBarItemForWindow:atIndex:] + 625
28 AppKit 0x7fff27a89b96 -[NSWindowStackController insertWindow:atIndex:] + 628
29 AppKit 0x7fff27a8990b -[NSWindowStackController addWindow:] + 437
30 AppKit 0x7fff276180ff -[NSWindow(NSWindowTabbing) _restoreTabbedWindowStateWithCoder:] + 299
31 AppKit 0x7fff27533c82 -[NSWindow restoreStateWithCoder:] + 96
32 AppKit 0x7fff274fcf17 restorePersistentStateWithWindowRestoration + 1004
33 AppKit 0x7fff27533be2 -[NSPersistentUIRestorer invokeRestoration:] + 572
34 AppKit 0x7fff27533947 __79-[NSPersistentUIRestorer finishedRestoringWindowsWithZOrder:completionHandler:]_block_invoke + 194
35 AppKit 0x7fff27533723 +[NSWindow _batchMinimizeWindowsWithBlock:] + 86
36 AppKit 0x7fff274fd475 -[NSPersistentUIRestorer finishedRestoringWindowsWithZOrder:completionHandler:] + 705
37 AppKit 0x7fff27532a79 __82-[NSPersistentUIRestorer restoreStateFromRecords:usingDelegate:completionHandler:]_block_invoke_3 + 168
38 AppKit 0x7fff2753298e __99-[NSApplication(NSPersistentUIRestorationSupport) _restoreWindowWithRestoration:completionHandler:]_block_invoke + 365
39 AppKit 0x7fff27cb94e3 -[NSDocument(NSPersistentUISupport) restoreDocumentWindowWithIdentifier:state:completionHandler:] + 497
40 AppKit 0x7fff2777d3c4 -[NSDocumentControllerPersistentRestoration loadedDocument:forAutoID:] + 176
41 AppKit 0x7fff27782221 __89-[NSDocumentController reopenDocumentForURL:withContentsOfURL:display:completionHandler:]_block_invoke_2 + 185
42 AppKit 0x7fff27790f70 ___NSMainRunLoopPerformBlock_block_invoke + 25
43 CoreFoundation 0x7fff29cae87c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
44 CoreFoundation 0x7fff29c91253 __CFRunLoopDoBlocks + 275
45 CoreFoundation 0x7fff29c91018 __CFRunLoopRun + 3128
46 CoreFoundation 0x7fff29c90153 CFRunLoopRunSpecific + 483
47 HIToolbox 0x7fff28f7ad96 RunCurrentEventLoopInMode + 286
48 HIToolbox 0x7fff28f7ab06 ReceiveNextEventCommon + 613
49 HIToolbox 0x7fff28f7a884 _BlockUntilNextEventMatchingListInModeWithFilter + 64
50 AppKit 0x7fff2722ba73 _DPSNextEvent + 2085
51 AppKit 0x7fff279c1e34 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
52 AppKit 0x7fff27220885 -[NSApplication run] + 764
53 AppKit 0x7fff271efa72 NSApplicationMain + 804
54 MyApp 0x106be1479 main (AppDelegate.swift:17)
55 libdyld.dylib 0x7fff51adc015 start + 1
Update 1:
Running application with zombies shows the following warnings in the output
objc[67272]: Class _NSZombie_CFReadStream is implemented in both ?? (0x6040000bb290) and ?? (0x6040000b8150). One of the two will be used. Which one is undefined.
objc[67272]: Class _NSZombie_NSMachPort is implemented in both ?? (0x604000151990) and ?? (0x6040001532d0). One of the two will be used. Which one is undefined.
objc[67272]: Class _NSZombie_CFMachPort is implemented in both ?? (0x604000157110) and ?? (0x60400015c0d0). One of the two will be used. Which one is undefined.
objc[67272]: Class _NSZombie_NSConcreteTask is implemented in both ?? (0x604000157250) and ?? (0x604000153a50). One of the two will be used. Which one is undefined.
objc[67272]: Class _NSZombie_NSConcreteFileHandle is implemented in both ?? (0x60400016f450) and ?? (0x604000170c90). One of the two will be used. Which one is undefined.
objc[67272]: Class _NSZombie_NSConcreteFileHandle is implemented in both ?? (0x60400016f450) and ?? (0x6040001724d0). One of the two will be used. Which one is undefined.
Update 2:
I managed to reproduce the exact call stack using symbolic break points (but still have never seen the actual crash).
Then using LLDB I requested the information about the button and found out that it is just a regular button with recessed style. Not sure why it causes crash sometimes. May be it's just the first leaf in view hierarchy tree.
For curious ones, here's how I got that information:
(lldb) expr -l Swift -- import Cocoa
(lldb) po $arg1
<NSButton: 0x60f0000ebdb0>
(lldb) expr -l Swift -- let $btn = unsafeBitCast(0x60f0000f7660, to: NSButton.self)
(lldb) expr -l Swift -- print($btn.title)

Error while Launching saying NSInternalInconsistencyException

Need help. receiving below error while launching the application
Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Application windows are expected to have a root view controller at the end of application launch
Native stack trace:
0 CoreFoundation 0x00000001160421e6 exceptionPreprocess + 294
1 libobjc.A.dylib 0x0000000116fdf031 objc_exception_throw + 48
2 CoreFoundation 0x0000000116047472 +[NSException raise:format:arguments:] + 98
3 Foundation 0x0000000114f7b652 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 UIKit 0x0000000112d1bb96 -[UIApplication _runWithMainScene:transitionContext:completion:] + 3064
5 UIKit 0x00000001130dde4a __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
6 UIKit 0x00000001134b0909 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
7 UIKit 0x00000001130dda86 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
8 UIKit 0x00000001130de2a7 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 675
9 UIKit 0x0000000113a4f4d4 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 299
10 UIKit 0x0000000113a4f36e -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
11 UIKit 0x000000011373362d __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
12 UIKit 0x000000011392e387 _performActionsWithDelayForTransitionContext + 100
13 UIKit 0x00000001137334f7 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
14 UIKit 0x00000001134affb0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
15 UIKit 0x0000000112d19f0c -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
16 UIKit 0x00000001132eca97 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
17 FrontBoardServices 0x000000011d9c32f3 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 331
18 FrontBoardServices 0x000000011d9cbcfa __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 225
19 libdispatch.dylib 0x0000000117c74779 _dispatch_client_callout + 8
20 libdispatch.dylib 0x0000000117c79931 _dispatch_block_invoke_direct + 317
21 FrontBoardServices 0x000000011d9f7470 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24
22 FrontBoardServices 0x000000011d9f712e -[FBSSerialQueue _performNext] + 439
23 FrontBoardServices 0x000000011d9f768e -[FBSSerialQueue _performNextFromRunLoopSource] + 45
24 CoreFoundation 0x0000000115fe4bb1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
25 CoreFoundation 0x0000000115fc94af __CFRunLoopDoSources0 + 271
26 CoreFoundation 0x0000000115fc8a6f __CFRunLoopRun + 1263
27 CoreFoundation 0x0000000115fc830b CFRunLoopRunSpecific + 635
28 GraphicsServices 0x0000000119779a73 GSEventRunModal + 62
29 UIKit 0x0000000112d1d0b7 UIApplicationMain + 159
30 ??? 0x000000013437347e 0x0 + 5171000446
31 ??? 0x0000000134373213 0x0 + 5170999827
Application windows are expected to have a root view controller at the end of application
It seems that you didn't set the RootViewController.It worked fine in old version.But in the new version ,you should set it in AppDelegate
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
// Override point for customization after application launch.
// If not required for your application you can safely delete this method
var indexVC = new XXXViewController ();//your viewcontroller
Window = new UIWindow ((CGRect)UIScreen.MainScreen.Bounds);
Window .RootViewController = indexVC;
Window .MakeKeyAndVisible ();
return true;
}

[NSSearchField object]: unrecognized selector sent to instance

I'm testing Swift in a simple Mac app. I got a NSToolbar in Storyboard and draw a NSSearchfield inside. The NSSearchfiled is connected to the First Responder's method controlTextDidChange (the first responder is the ViewController where I added NSTextFieldDelegate).
This is the method:
#IBAction override func controlTextDidChange(obj: NSNotification!) {
println("searching...")
println(obj.object.stringValue)
}
The method gets correctly called every time a new character is searched and the app does not crash however what's being returned is the following:
searching...
2014-08-03 09:56:57.770 TestApp[1129:24219] -[NSSearchField object]: unrecognized selector sent to instance 0x6080001a07e0
2014-08-03 09:56:57.770 TestApp[1129:24219] -[NSSearchField object]: unrecognized selector sent to instance 0x6080001a07e0
2014-08-03 09:56:57.775 TestApp[1129:24219] (
0 CoreFoundation 0x00007fff92e6af1c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff930ae74e objc_exception_throw + 43
2 CoreFoundation 0x00007fff92e6de4d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff92db63c4 ___forwarding___ + 1028
4 CoreFoundation 0x00007fff92db5f38 _CF_forwarding_prep_0 + 120
5 TestApp 0x000000010000c187 _TFC9TestApp14ViewController20controlTextDidChangefS0_FGSQCSo14NSNotification_T_ + 231
6 TestApp 0x000000010000c582 _TToFC9TestApp14ViewController20controlTextDidChangefS0_FGSQCSo14NSNotification_T_ + 66
7 libsystem_trace.dylib 0x00007fff9117bc07 _os_activity_initiate + 75
8 AppKit 0x00007fff8d52b168 -[NSApplication sendAction:to:from:] + 410
9 AppKit 0x00007fff8d52af90 -[NSControl sendAction:to:] + 86
10 AppKit 0x00007fff8d6faf91 __26-[NSCell _sendActionFrom:]_block_invoke + 131
11 libsystem_trace.dylib 0x00007fff9117bc07 _os_activity_initiate + 75
12 AppKit 0x00007fff8d57329e -[NSCell _sendActionFrom:] + 144
13 AppKit 0x00007fff8d92fe8f __64-[NSSearchFieldCell(NSSearchFieldCell_Local) _sendPartialString]_block_invoke + 63
14 libsystem_trace.dylib 0x00007fff9117bc07 _os_activity_initiate + 75
15 AppKit 0x00007fff8d92fe47 -[NSSearchFieldCell(NSSearchFieldCell_Local) _sendPartialString] + 186
16 Foundation 0x00007fff932ee3d3 __NSFireTimer + 95
17 CoreFoundation 0x00007fff92dbf464 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
18 CoreFoundation 0x00007fff92dbf0f3 __CFRunLoopDoTimer + 1059
19 CoreFoundation 0x00007fff92e320fd __CFRunLoopDoTimers + 301
20 CoreFoundation 0x00007fff92d7b4d2 __CFRunLoopRun + 2018
21 CoreFoundation 0x00007fff92d7aaa8 CFRunLoopRunSpecific + 296
22 HIToolbox 0x00007fff90adcaff RunCurrentEventLoopInMode + 235
23 HIToolbox 0x00007fff90adc872 ReceiveNextEventCommon + 431
24 HIToolbox 0x00007fff90adc6b3 _BlockUntilNextEventMatchingListInModeWithFilter + 71
25 AppKit 0x00007fff8d35c2a5 _DPSNextEvent + 1000
26 AppKit 0x00007fff8d35ba79 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 139
27 AppKit 0x00007fff8d34fad3 -[NSApplication run] + 594
28 AppKit 0x00007fff8d33b2de NSApplicationMain + 1778
29 TestApp 0x000000010000da72 top_level_code + 34
30 TestApp 0x000000010000daaa main + 42
31 libdyld.dylib 0x00007fff8cb765c9 start + 1
32 ??? 0x0000000000000003 0x0 + 3
)
I can't figure out where the "unrecognized selector sent to instance" comes from.
controlTextDidChange method expects NSSearchField!, not NSNotification!.
Replace
#IBAction override func controlTextDidChange(obj: NSNotification!) {
println("searching...")
println(obj.object.stringValue)
}
with
#IBAction override func controlTextDidChange(obj: NSSearchField!) {
println("searching...")
println(obj.stringValue)
}
Solved by defining a custom method
#IBAction func controlTextDidChange_Custom(obj: NSSearchField!) {
if (!obj.stringValue.isEmpty) {
println("Searched: \(obj.stringValue)")
} else {
println("EMPTY")
}
}

(iOS) What does kbViewRecoverNormalState means?

We have this crash in our app that has this kind of log.
"date= 2013-02-03 07:12:17 +0000;
buildVersion = 1.0.0;
model = iPhone;
systemName = iPhone OS;
systemVersion = 5.1.1;
timeSpent = 1008.14;
uid = 63743f3790afda4d3bffc7beb8877fa9cfbfedfe;
reason = -[__NSCFType kbViewRecoverNormalState]: unrecognized selector sent to instance 0xdd1dfe0;
stackTrace =
(
0 CoreFoundation 0x371288a7 __exceptionPreprocess + 186
1 libobjc.A.dylib 0x34e2d259 objc_exception_throw + 32
2 CoreFoundation 0x3712ba9b -[NSObject doesNotRecognizeSelector:] + 174
3 CoreFoundation 0x3712a915 ___forwarding___ + 300
4 CoreFoundation 0x37085650 _CF_forwarding_prep_0 + 48
5 SogouInputIPhone4.dylib 0x01a1982b -[AppStateMonitor exitSogouInputMethod] + 190
6 SogouInputIPhone4.dylib 0x01a196e5 -[AppStateMonitor didEnterBackground] + 20
7 Foundation 0x3798d4ff __57 -[NSNotificationCenteraddObserver:selector:name:object:] _block_invoke_0 + 18
8 CoreFoundation 0x370f4547 ___CFXNotificationPost_block_invoke_0 + 70
9 CoreFoundation 0x37080097 _CFXNotificationPost + 1406
10 Foundation 0x379013eb -[NSNotificationCenterpostNotificationName:object:userInfo:] + 66
11 UIKit 0x30e6c255 -[UIApplication _handleApplicationSuspend:eventInfo:] +792
12 UIKit 0x30dfceff -[UIApplication handleEvent:withNewEvent:] + 2094
13 UIKit 0x30dfc567 -[UIApplication sendEvent:] + 54
14 UIKit 0x30dfbf3b _UIApplicationHandleEvent + 5826
15 GraphicsServices 0x3383e22b PurpleEventCallback + 882
16 CoreFoundation 0x370fc523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__+ 38
17 CoreFoundation 0x370fc4c5 __CFRunLoopDoSource1 + 140
18 CoreFoundation 0x370fb313 __CFRunLoopRun + 1370
19 CoreFoundation 0x3707e4a5 CFRunLoopRunSpecific + 300
20 CoreFoundation 0x3707e36d CFRunLoopRunInMode + 104
21 GraphicsServices 0x3383d439 GSEventRunModal + 136
22 UIKit 0x30e2acd5 UIApplicationMain + 1080
23 MyApp 0x0014506f _mh_execute_header + 295023
24 MyApp 0x000ff058 _mh_execute_header + 8280
);"
That is a custom crash log that is not symbolicated when we migrated to Xcode 4.5.
My question is, what is kbViewRecoverNormalState means? What class calls this selector? Since we can't read the stack trace clearly, we don't have any idea about this.
And is there any possible solution for this uninformative call stack? It is working on the device if it is connected to Xcode (debug/release). But when release on iTunes and/or created an IPA file, it doesn't work.
Thanks!
It seems like you are test your app in jailbroken device.
SogouInputIPhone4.dylib 0x01a1982b -[AppStateMonitor exitSogouInputMethod]
Its the SogouInputIPhone4 which cause the crash

Resources