android - 设备截图在 Android 调试监视器中不起作用

标签 android android-studio

我正在尝试在 DDMS 中截取屏幕截图,以使用 Hierarchy Viewer 并了解 View 。但是当我尝试使用按钮“截屏”时,总是返回黑屏。见下文:

enter image description here

错误日志:

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/

相关文章:

java - Android Studio - 包含和使用 .so 库

android - Android Studio 无法识别 LG G4

Android谷歌地图顺利改变圆半径

android - fragment 显示正在重置

android - MuPdf Android JNI 库非常大

android - 无法在 Android Studio 中更新 JDK 位置

android - 在项目中时如何进入Android Studio的主屏幕?

android - 如何为 Android Studio 中的所有配置删除未使用的字符串资源?

android - Android 是否缓存在 xml 布局文件中加载的可绘制资源?

android - 如何在 Android 中存储游戏级别分数?