I ran into the same problem when attempting to get up and running on OSX. I have managed to get it working and wanted to share my solution for anyone else who might run into this in future...
- I ran "adb logcat" in order to view the logcat output on the virtual device. This showed the following error:
E/gralloc_goldfish( 937): gralloc_alloc: Mismatched usage flags: 1080 x 1920, usage 333
W/GraphicBufferAllocator( 937): alloc(1080, 1920, 1, 00000333, ...) failed -22 (Invalid argument)
E/ ( 937): GraphicBufferAlloc::createGraphicBuffer(w=1080, h=1920) failed (Invalid argument), handle=0x0
E/BufferQueue( 1864): [ScreenshotClient] dequeueBuffer: SurfaceComposer::createGraphicBuffer failed
After some further digging, I read about a different issue where someone suggested making the emulator is not using host GPU. Unticked this option in my emulator settings (Virtual Device Manager... Emulation options - uncheck "Use Host GPU") and restarted. I was then able to take screenshots from the virtual device.
Barry.