Android Studio sun.font.CompositeFont 无法转换为 sun.font.PhysicalFont
Android Studio sun.font.CompositeFont cannot be cast to sun.font.PhysicalFont
在两台不同的 Ubuntu 计算机上尝试 运行 Android Studio 2.2.3 时,我一直收到此错误。一个 运行ning 14.04 Trusty 和另一个 16.04 Xenial.
它 运行 是初始屏幕,加载栏到达末尾,然后就停在那里,控制台中显示此错误。
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
Looking in classpath from com.intellij.util.lang.UrlClassLoader@2077d4de for /com/sun/jna/linux-x86-64/libjnidispatch.so
Found library resource at jar:file:/home/me/Downloads/android-studio/lib/jna.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so
Trying /home/me/.AndroidStudio2.2/system/tmp/jna3820816485682346846.tmp
Found jnidispatch at /home/me/.AndroidStudio2.2/system/tmp/jna3820816485682346846.tmp
[ 9485] WARN - dea.updater.SdkComponentSource - File /home/me/.android/repositories.cfg could not be loaded.
[ 9618] WARN - s.RepoProgressIndicatorAdapter - File /home/me/.android/repositories.cfg could not be loaded.
[ 9994] ERROR - llij.ide.plugins.PluginManager - java.lang.ClassCastException: sun.font.CompositeFont cannot be cast to sun.font.PhysicalFont
java.lang.RuntimeException: java.lang.ClassCastException: sun.font.CompositeFont cannot be cast to sun.font.PhysicalFont
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:204)
at com.intellij.idea.MainImpl.run(MainImpl.java:52)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access0(EventQueue.java:97)
at java.awt.EventQueue.run(EventQueue.java:709)
at java.awt.EventQueue.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
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)
Caused by: java.lang.ClassCastException: sun.font.CompositeFont cannot be cast to sun.font.PhysicalFont
at sun.font.CompositeFont.doDeferredInitialisation(CompositeFont.java:293)
at sun.font.CompositeFont.getSlotFont(CompositeFont.java:360)
at sun.font.CompositeGlyphMapper.getSlotMapper(CompositeGlyphMapper.java:114)
at sun.font.CompositeGlyphMapper.convertToGlyph(CompositeGlyphMapper.java:124)
at sun.font.CompositeGlyphMapper.charToGlyph(CompositeGlyphMapper.java:162)
at sun.font.CompositeStrike.getCodePointAdvance(CompositeStrike.java:158)
at sun.font.FontDesignMetrics.handleCharWidth(FontDesignMetrics.java:416)
at sun.font.FontDesignMetrics.getLatinCharWidth(FontDesignMetrics.java:425)
at sun.font.FontDesignMetrics.stringWidth(FontDesignMetrics.java:476)
at sun.swing.SwingUtilities2.stringWidth(SwingUtilities2.java:403)
at javax.swing.SwingUtilities.layoutCompoundLabelImpl(SwingUtilities.java:1005)
at javax.swing.SwingUtilities.layoutCompoundLabel(SwingUtilities.java:890)
at javax.swing.plaf.basic.BasicGraphicsUtils.getPreferredButtonSize(BasicGraphicsUtils.java:282)
at javax.swing.plaf.basic.BasicButtonUI.getPreferredSize(BasicButtonUI.java:376)
at javax.swing.plaf.basic.BasicButtonUI.getMinimumSize(BasicButtonUI.java:366)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1744)
at java.awt.GridLayout.minimumLayoutSize(GridLayout.java:390)
at java.awt.Container.minimumSize(Container.java:1848)
at java.awt.Container.getMinimumSize(Container.java:1832)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1746)
at java.awt.GridBagLayout.GetLayoutInfo(GridBagLayout.java:1117)
at java.awt.GridBagLayout.getLayoutInfo(GridBagLayout.java:916)
at java.awt.GridBagLayout.minimumLayoutSize(GridBagLayout.java:750)
at java.awt.Container.minimumSize(Container.java:1848)
at java.awt.Container.getMinimumSize(Container.java:1832)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1746)
at java.awt.BorderLayout.minimumLayoutSize(BorderLayout.java:663)
at java.awt.Container.minimumSize(Container.java:1848)
at java.awt.Container.getMinimumSize(Container.java:1832)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1746)
at java.awt.BorderLayout.minimumLayoutSize(BorderLayout.java:673)
at java.awt.Container.minimumSize(Container.java:1848)
at java.awt.Container.getMinimumSize(Container.java:1832)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1746)
at javax.swing.JRootPane$RootLayout.minimumLayoutSize(JRootPane.java:944)
at java.awt.Container.minimumSize(Container.java:1848)
at java.awt.Container.getMinimumSize(Container.java:1832)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1746)
at java.awt.BorderLayout.minimumLayoutSize(BorderLayout.java:663)
at java.awt.Container.minimumSize(Container.java:1848)
at java.awt.Container.getMinimumSize(Container.java:1832)
at com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrame.<init>(FlatWelcomeFrame.java:109)
at com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrameProvider.createFrame(FlatWelcomeFrameProvider.java:29)
at com.intellij.openapi.wm.impl.welcomeScreen.WelcomeFrame.showNow(WelcomeFrame.java:171)
at com.intellij.idea.IdeaApplication$IdeStarter.main(IdeaApplication.java:340)
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:200)
... 16 more
[ 9998] ERROR - llij.ide.plugins.PluginManager - Android Studio 2.2.3 Build #AI-145.3537739
[ 9998] ERROR - llij.ide.plugins.PluginManager - JDK: 1.8.0_76-release
[ 9998] ERROR - llij.ide.plugins.PluginManager - VM: OpenJDK 64-Bit Server VM
[ 9998] ERROR - llij.ide.plugins.PluginManager - Vendor: JetBrains s.r.o
[ 9998] ERROR - llij.ide.plugins.PluginManager - OS: Linux
[ 9999] ERROR - llij.ide.plugins.PluginManager - Last Action:
^C[ 13652] WARN - pl.local.NativeFileWatcherImpl - Watcher terminated with exit code 130
首先感谢评论问题的各位,你们的意见解决了我的问题。我只是想添加一个正确的答案。
正如在问题评论中的几个轨道 link 中所发现的,问题似乎与 Mac 中的 Helvetica 字体文件有关。来自 link:
The problem is a bad font: /usr/share/fonts/TTF/Helvetica.ttf
It was copied from OS X machine and is attached.
When the font is removed, the problem is resolved.
号称修复,IDEA给我跑。只需要等待 Google 将更改集成到我怀疑的 Android Studio 版本中。
在两台不同的 Ubuntu 计算机上尝试 运行 Android Studio 2.2.3 时,我一直收到此错误。一个 运行ning 14.04 Trusty 和另一个 16.04 Xenial.
它 运行 是初始屏幕,加载栏到达末尾,然后就停在那里,控制台中显示此错误。
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
Looking in classpath from com.intellij.util.lang.UrlClassLoader@2077d4de for /com/sun/jna/linux-x86-64/libjnidispatch.so
Found library resource at jar:file:/home/me/Downloads/android-studio/lib/jna.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so
Trying /home/me/.AndroidStudio2.2/system/tmp/jna3820816485682346846.tmp
Found jnidispatch at /home/me/.AndroidStudio2.2/system/tmp/jna3820816485682346846.tmp
[ 9485] WARN - dea.updater.SdkComponentSource - File /home/me/.android/repositories.cfg could not be loaded.
[ 9618] WARN - s.RepoProgressIndicatorAdapter - File /home/me/.android/repositories.cfg could not be loaded.
[ 9994] ERROR - llij.ide.plugins.PluginManager - java.lang.ClassCastException: sun.font.CompositeFont cannot be cast to sun.font.PhysicalFont
java.lang.RuntimeException: java.lang.ClassCastException: sun.font.CompositeFont cannot be cast to sun.font.PhysicalFont
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:204)
at com.intellij.idea.MainImpl.run(MainImpl.java:52)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access0(EventQueue.java:97)
at java.awt.EventQueue.run(EventQueue.java:709)
at java.awt.EventQueue.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
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)
Caused by: java.lang.ClassCastException: sun.font.CompositeFont cannot be cast to sun.font.PhysicalFont
at sun.font.CompositeFont.doDeferredInitialisation(CompositeFont.java:293)
at sun.font.CompositeFont.getSlotFont(CompositeFont.java:360)
at sun.font.CompositeGlyphMapper.getSlotMapper(CompositeGlyphMapper.java:114)
at sun.font.CompositeGlyphMapper.convertToGlyph(CompositeGlyphMapper.java:124)
at sun.font.CompositeGlyphMapper.charToGlyph(CompositeGlyphMapper.java:162)
at sun.font.CompositeStrike.getCodePointAdvance(CompositeStrike.java:158)
at sun.font.FontDesignMetrics.handleCharWidth(FontDesignMetrics.java:416)
at sun.font.FontDesignMetrics.getLatinCharWidth(FontDesignMetrics.java:425)
at sun.font.FontDesignMetrics.stringWidth(FontDesignMetrics.java:476)
at sun.swing.SwingUtilities2.stringWidth(SwingUtilities2.java:403)
at javax.swing.SwingUtilities.layoutCompoundLabelImpl(SwingUtilities.java:1005)
at javax.swing.SwingUtilities.layoutCompoundLabel(SwingUtilities.java:890)
at javax.swing.plaf.basic.BasicGraphicsUtils.getPreferredButtonSize(BasicGraphicsUtils.java:282)
at javax.swing.plaf.basic.BasicButtonUI.getPreferredSize(BasicButtonUI.java:376)
at javax.swing.plaf.basic.BasicButtonUI.getMinimumSize(BasicButtonUI.java:366)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1744)
at java.awt.GridLayout.minimumLayoutSize(GridLayout.java:390)
at java.awt.Container.minimumSize(Container.java:1848)
at java.awt.Container.getMinimumSize(Container.java:1832)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1746)
at java.awt.GridBagLayout.GetLayoutInfo(GridBagLayout.java:1117)
at java.awt.GridBagLayout.getLayoutInfo(GridBagLayout.java:916)
at java.awt.GridBagLayout.minimumLayoutSize(GridBagLayout.java:750)
at java.awt.Container.minimumSize(Container.java:1848)
at java.awt.Container.getMinimumSize(Container.java:1832)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1746)
at java.awt.BorderLayout.minimumLayoutSize(BorderLayout.java:663)
at java.awt.Container.minimumSize(Container.java:1848)
at java.awt.Container.getMinimumSize(Container.java:1832)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1746)
at java.awt.BorderLayout.minimumLayoutSize(BorderLayout.java:673)
at java.awt.Container.minimumSize(Container.java:1848)
at java.awt.Container.getMinimumSize(Container.java:1832)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1746)
at javax.swing.JRootPane$RootLayout.minimumLayoutSize(JRootPane.java:944)
at java.awt.Container.minimumSize(Container.java:1848)
at java.awt.Container.getMinimumSize(Container.java:1832)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1746)
at java.awt.BorderLayout.minimumLayoutSize(BorderLayout.java:663)
at java.awt.Container.minimumSize(Container.java:1848)
at java.awt.Container.getMinimumSize(Container.java:1832)
at com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrame.<init>(FlatWelcomeFrame.java:109)
at com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrameProvider.createFrame(FlatWelcomeFrameProvider.java:29)
at com.intellij.openapi.wm.impl.welcomeScreen.WelcomeFrame.showNow(WelcomeFrame.java:171)
at com.intellij.idea.IdeaApplication$IdeStarter.main(IdeaApplication.java:340)
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:200)
... 16 more
[ 9998] ERROR - llij.ide.plugins.PluginManager - Android Studio 2.2.3 Build #AI-145.3537739
[ 9998] ERROR - llij.ide.plugins.PluginManager - JDK: 1.8.0_76-release
[ 9998] ERROR - llij.ide.plugins.PluginManager - VM: OpenJDK 64-Bit Server VM
[ 9998] ERROR - llij.ide.plugins.PluginManager - Vendor: JetBrains s.r.o
[ 9998] ERROR - llij.ide.plugins.PluginManager - OS: Linux
[ 9999] ERROR - llij.ide.plugins.PluginManager - Last Action:
^C[ 13652] WARN - pl.local.NativeFileWatcherImpl - Watcher terminated with exit code 130
首先感谢评论问题的各位,你们的意见解决了我的问题。我只是想添加一个正确的答案。
正如在问题评论中的几个轨道 link 中所发现的,问题似乎与 Mac 中的 Helvetica 字体文件有关。来自 link:
The problem is a bad font: /usr/share/fonts/TTF/Helvetica.ttf
It was copied from OS X machine and is attached.
When the font is removed, the problem is resolved.
号称修复,IDEA给我跑。只需要等待 Google 将更改集成到我怀疑的 Android Studio 版本中。