简体   繁体   English

Android Studio 0.8 Beta屏幕捕获/视频捕获已损坏

[英]Android Studio 0.8 Beta Screen Capture / Video Capture broken

I upgraded Android Studio from 0.6.2 to 0.8 beta last night, with no issues. 我昨晚将Android Studio从0.6.2升级到了0.8 beta,没有任何问题。

Unfortunately, I just tried to grab a video capture from Glass (I've been sending regular progress updates in this way) to find it doesn't work any more. 不幸的是,我只是试图从Glass获取视频捕获(我一直在以这种方式发送定期进度更新)以发现它不再起作用。 Pressing record skips the actual recording process and jumps straight to the save dialogue, saving a video file with no content. 按下记录会跳过实际录制过程并直接跳到保存对话框,保存没有内容的视频文件。

The screen capture button shows an error: 屏幕捕获按钮显示错误:

Unexpected error while obtaining screenshot: java.lang.IllegalStateException: @NotNull method com/android/tools/idea/ddms/screenshot/DeviceArtDescriptor.getArtDescriptor must not return null

Any ideas what might be causing this or how to fix it? 可能导致此问题或如何解决问题的任何想法?

It is a known issue, and has been fixed for 0.8.2; 这是一个已知问题,并已修复为0.8.2; however, there is a work-around to fix it for this version. 但是,有一个解决此版本的解决方法。

Solution

If anyone needs a workaround: edit the following file in your Android Studio distribution: plugins/android/lib/device-art-resources/device-art.xml 如果有人需要解决方法:在Android Studio发行版中编辑以下文件: plugins / android / lib / device-art-resources / device-art.xml

On line 33, insert <!-- and on line 43 insert --> 在第33行,插入<!--并在第43行插入-->

In other words, comment out the two tv device definitions. 换句话说,注释掉两个电视设备定义。 They don't supply a portrait orientation, which is what is causing the crash in the screenshot code (when it searches for device art to surround the device with). 它们不提供纵向方向,这是导致屏幕截图代码崩溃的原因(当它搜索设备艺术以包围设备时)。

If you do this, note that you may get conflicts in a future update, so please copy the original file somewhere and restore it before updating to 0.8.2. 如果这样做,请注意您在将来的更新中可能会出现冲突,因此请将原始文件复制到某处并在更新到0.8.2之前将其还原。

Posted by Tnor, on https://code.google.com/p/android/issues/detail?id=72580 . 由Tnor发布,位于https://code.google.com/p/android/issues/detail?id=72580

It turns out this was entirely my own fault - I was running an emulator I'd forgotten about which meant adb didn't know which device I wanted to record. 事实证明这完全是我自己的错 - 我正在运行一个我忘记的模拟器,这意味着adb不知道我想要记录哪个设备。

The trick is to make sure only one device is connected to adb, or set a default. 诀窍是确保只有一个设备连接到adb,或设置默认设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM