在 USB 调试时,Android-Studio 无法使用 ArrayOutOfBounds 异常
Posted
技术标签:
【中文标题】在 USB 调试时,Android-Studio 无法使用 ArrayOutOfBounds 异常【英文标题】:Android-Studio is unusable with ArrayOutOfBounds exceptions while USB debugging 【发布时间】:2015-02-02 23:11:38 【问题描述】:我很难在 Opensuse 13.2 上安装可用的 android Studio。 我已经尝试过 Java OpenSDK 1.7.0_75-b13 和 1.8.0_40-b10 以及 Oracle 1.8.0_31-b13(设置 STUDIO_JDK 环境变量并检查文件->其他设置->默认项目结构)。我已经从Android developer site. 从头开始安装了 Android Studio 我已经在 ~/Android/Sdk 中安装了一个全新的 SDK。我删除了旧的 ~/.AndroidStudio 目录以尝试清除任何以前的配置,但这并没有帮助。
打开项目时界面无法使用,因为不断抛出 ArrayOutOfBounds 异常。这些在 Android Studio 核心中,而不是我编写的代码。以下屏幕截图说明了错误。
当通过 USB 连接 Android 设备进行调试时会发生这种情况。
-29359205: -29359205
java.lang.ArrayIndexOutOfBoundsException: -29359205
at sun.font.FileFontStrike.getCachedGlyphptr(FileFontStrike.java:472)
at sun.font.FileFontStrike.getSlot0GlyphImagePtrs(FileFontStrike.java:438)
at sun.font.CompositeStrike.getGlyphImagePtrs(CompositeStrike.java:115)
at sun.font.GlyphList.mapChars(GlyphList.java:272)
at sun.font.GlyphList.setFromString(GlyphList.java:244)
at sun.java2d.pipe.GlyphListPipe.drawString(GlyphListPipe.java:71)
at sun.java2d.SunGraphics2D.drawString(SunGraphics2D.java:2928)
at com.intellij.openapi.editor.impl.EditorImpl.drawChars(EditorImpl.java:3426)
at com.intellij.openapi.editor.impl.EditorImpl.access$5000(EditorImpl.java:132)
at com.intellij.openapi.editor.impl.EditorImpl$CachedFontContent.flushContent(EditorImpl.java:2948)
at com.intellij.openapi.editor.impl.EditorImpl$CachedFontContent.access$5100(EditorImpl.java:2914)
at com.intellij.openapi.editor.impl.EditorImpl.flushCachedChars(EditorImpl.java:2989)
at com.intellij.openapi.editor.impl.EditorImpl.paintText(EditorImpl.java:2865)
at com.intellij.openapi.editor.impl.EditorImpl.paint(EditorImpl.java:1986)
at com.intellij.openapi.editor.impl.EditorComponentImpl.paintComponent(EditorComponentImpl.java:153)
at javax.swing.JComponent.paint(JComponent.java:1056)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JViewport.paint(JViewport.java:728)
at com.intellij.ui.components.JBViewport.paint(JBViewport.java:119)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5219)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1572)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1495)
at javax.swing.RepaintManager.paint(RepaintManager.java:1265)
at javax.swing.JComponent._paintImmediately(JComponent.java:5167)
at javax.swing.JComponent.paintImmediately(JComponent.java:4978)
at javax.swing.RepaintManager$4.run(RepaintManager.java:824)
at javax.swing.RepaintManager$4.run(RepaintManager.java:807)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:807)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:782)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:731)
at javax.swing.RepaintManager.access$1300(RepaintManager.java:64)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1720)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:749)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:702)
at java.awt.EventQueue$3.run(EventQueue.java:696)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:719)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:697)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
什么给了?我必须解决什么问题才能获得可用的 Android 工作室?
看来这可能是Opensuse issue。 还有一个Java OpenStreetMap bug 的解决方法对我不起作用。
【问题讨论】:
这看起来不像你的 JRE。试试 Oracle 的 Java 发行版。 【参考方案1】:Opensuse bug表示安装texlive-arphic-fonts包时触发OpenJDK字体问题。删除它对我来说是一种解决方法。
【讨论】:
以上是关于在 USB 调试时,Android-Studio 无法使用 ArrayOutOfBounds 异常的主要内容,如果未能解决你的问题,请参考以下文章
使用 USB 电缆调试时 Gradle 任务 assembleDebug 失败