Reputation: 863
...and every subsequent attempt at launching after that results in a crash. Once any AVD is launched and quit, it can never be launched successfully again. I've tried ARM and Intel ABIs, with and without snapshots. Nothing seems to make a difference.
I can't even delete that AVD from the AVD Manager's list; it claims it's "currently running in an emulator and can't be deleted", which is it not (there's no emulator process running). I have to manually delete the .avd files from ~/.android/avd/, and then create an entirely new AVD. I see no other process than the Android Studio app running (at least nothing that looks remotely related), but when I quit it, it asks me if I want to "disconnect from the process 'app'" (it asks multiple times, actually), even though Activity Monitor shows no process named "app". The emulator continues to crash after quitting and restarting Android Studio, as well as the machine itself.
None of the other AVD-related posts on SO seem to be relevant.
I'm running the latest version of Android Studio (just updated to 0.8.2 via the built-in updater), on the latest version of OS X Mavericks. Here's the interesting part of the stack trace of the crash:
Process: emulator64-arm [10831]
Path: /Users/USER/*/Android Studio.app/sdk/tools/emulator64-arm
Identifier: emulator64-arm
Version: ???
Code Type: X86-64 (Native)
Parent Process: studio [3462]
Responsible: studio [3462]
User ID: 501
Date/Time: 2014-07-09 14:17:37.966 -0600
OS Version: Mac OS X 10.9.4 (13E28)
Report Version: 11
Anonymous UUID: B18B64F8-4A66-F624-243B-2AE2C192F57D
Sleep/Wake UUID: EE9F3B06-E894-4CA3-A022-8D4FC325A1BC
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
VM Regions Near 0:
-->
__TEXT 000000010b732000-000000010b966000 [ 2256K] r-x/rwx SM=COW /Users/USER/*/Android Studio.app/sdk/tools/emulator64-arm
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 emulator64-arm 0x000000010b8ae18a 0x10b732000 + 1556874
1 com.apple.AppKit 0x00007fff8f457321 __67-[NSWindow _updateSettingsSendingScreenChangeNotificationIfNeeded:]_block_invoke + 237
2 com.apple.AppKit 0x00007fff8f4571e8 NSPerformWithScreenUpdatesDisabled + 65
3 com.apple.AppKit 0x00007fff8f457197 -[NSWindow _updateSettingsSendingScreenChangeNotificationIfNeeded:] + 197
4 com.apple.AppKit 0x00007fff8f44f491 -[NSWindow _setFrame:updateBorderViewSize:] + 914
5 com.apple.AppKit 0x00007fff8f44ea0e -[NSWindow _oldPlaceWindow:] + 652
6 com.apple.AppKit 0x00007fff8f44de3c -[NSWindow _setFrameCommon:display:stashSize:] + 1633
7 com.apple.AppKit 0x00007fff8f46225c -[NSWindow setFrameOrigin:] + 369
8 emulator64-arm 0x000000010b8abeb4 0x10b732000 + 1547956
9 emulator64-arm 0x000000010b8a8e95 SDL_SetVideoMode + 469
10 emulator64-arm 0x000000010b77749b 0x10b732000 + 283803
11 emulator64-arm 0x000000010b778aa8 0x10b732000 + 289448
12 emulator64-arm 0x000000010b778d4e skin_window_create + 190
13 emulator64-arm 0x000000010b77b471 0x10b732000 + 300145
14 emulator64-arm 0x000000010b742599 qemu_main + 5833
15 emulator64-arm 0x000000010b74d656 SDL_main + 6086
16 emulator64-arm 0x000000010b8b0270 0x10b732000 + 1565296
17 com.apple.CoreFoundation 0x00007fff9726ce0c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
18 com.apple.CoreFoundation 0x00007fff9716082d _CFXNotificationPost + 2893
19 com.apple.Foundation 0x00007fff8ac407ba -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
20 com.apple.AppKit 0x00007fff8f334b69 -[NSApplication _postDidFinishNotification] + 289
21 com.apple.AppKit 0x00007fff8f33489c -[NSApplication _sendFinishLaunchingNotification] + 195
22 com.apple.AppKit 0x00007fff8f331786 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 570
23 com.apple.AppKit 0x00007fff8f3311db -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 242
24 com.apple.Foundation 0x00007fff8ac5ef0a -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 294
25 com.apple.Foundation 0x00007fff8ac5ed7d _NSAppleEventManagerGenericHandler + 106
26 com.apple.AE 0x00007fff8c91ae1f aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned int, unsigned char*) + 381
27 com.apple.AE 0x00007fff8c91ac32 dispatchEventAndSendReply(AEDesc const*, AEDesc*) + 31
28 com.apple.AE 0x00007fff8c91ab36 aeProcessAppleEvent + 315
29 com.apple.HIToolbox 0x00007fff8e098161 AEProcessAppleEvent + 56
30 com.apple.AppKit 0x00007fff8f32d0b6 _DPSNextEvent + 1026
31 com.apple.AppKit 0x00007fff8f32c89b -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
32 com.apple.AppKit 0x00007fff8f32099c -[NSApplication run] + 553
33 emulator64-arm 0x000000010b8b0917 main + 1351
34 emulator64-arm 0x000000010b7377e4 start + 52
Any tips/voodoo magic/suggestions on fixing this would be greatly appreciated.
Upvotes: 0
Views: 332
Reputation: 863
Answering my own question for posterity...
Further investigation reveals that quitting the AVD process while its window is on an external monitor is the cause of the crash. Doing so saves the position of the window to the "emulator-user.ini" file within the AVD's .avd directory, and when this value is larger than the main screen's bounds, the AVD will crash upon launch. Editing this value to one that is within the main screen's bounds will allow the AVD to successfully launch again.
Bug reported: https://code.google.com/p/android/issues/detail?id=73364.
Upvotes: 1