我正在尝试在 DDMS 中截取屏幕截图,以使用 Hierarchy Viewer 并了解 View 。但是当我尝试使用按钮“截屏”时,总是返回黑屏。见下文:
错误日志:
01-26 10:22:22.980: E/gralloc_goldfish(922): gralloc_alloc: Mismatched usage flags: 320 x 480, usage 333
01-26 10:22:22.980: W/GraphicBufferAllocator(922): alloc(320, 480, 1, 00000333, ...) failed -22 (Invalid argument)
01-26 10:22:22.980: E/(922): GraphicBufferAlloc::createGraphicBuffer(w=320, h=480) failed (Invalid argument), handle=0x0
01-26 10:22:22.980: E/BufferQueue(1788): [ScreenshotClient] dequeueBuffer: SurfaceComposer::createGraphicBuffer failed
我的模拟器: API 19 - Android 4.4.2 - 设备 3.2"QVGA (ADP2) (320, 480),使用主机 GPU
谁知道我该如何解决这个问题?
最佳答案
为此 AVD 关闭“使用主机 GPU”将解决此问题。
关于android - 设备截图在 Android 调试监视器中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21365312/