我无法运行任何版本的Android Studio 2.x.在<之后,它似乎随机地崩溃了同样的例外。 1分钟只需浏览项目中的文件:
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
我正在使用Java版本1.8.0_92运行OS X 10.11.4。
我在做拖拽的过程中看到了其他一些对此问题的引用。放弃操作,但升级JDK版本的公认解决方案似乎并没有解决我的问题。
FWIW我能够在不遇到此问题的情况下运行Studio 1.5。
答案 0 :(得分:0)
回答实际发生的原因,但source有这个:
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);
}
正如您所看到的,Callable
在某些情况下会返回null,这对于Integer
来说很好,但是一旦取消将其返回int
,您就会获得NPE。他们可能应该检查null并返回0。