无法启动 Android Studio

Posted

技术标签:

【中文标题】无法启动 Android Studio【英文标题】:Can't lauch Android Studio 【发布时间】:2022-01-04 17:36:19 【问题描述】:

我在使用 android Studio 时遇到问题。 当我安装最后一个版本时,如果我尝试启动,我有一个“启动失败”的白色窗口,我必须用任务管理器关闭它。

所以我尝试使用 4.1 版并收到以下消息:

java.lang.NoClassDefFoundError: Could not initialize class com.android.tools.idea.welcome.install.Haxm
    at com.android.tools.idea.updater.configure.ToolComponentsPanel.<clinit>(ToolComponentsPanel.java:65)
    at com.android.tools.idea.updater.configure.SdkUpdaterConfigPanel.$$$setupUI$$$(SdkUpdaterConfigPanel.java)
    at com.android.tools.idea.updater.configure.SdkUpdaterConfigPanel.<init>(SdkUpdaterConfigPanel.java:211)
    at com.android.tools.idea.updater.configure.SdkUpdaterConfigurable.createComponent(SdkUpdaterConfigurable.java:129)
    at com.intellij.openapi.options.ex.ConfigurableWrapper.createComponent(ConfigurableWrapper.java:162)
    at com.intellij.openapi.options.ex.ConfigurableCardPanel.lambda$createConfigurableComponent$4(ConfigurableCardPanel.java:109)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:894)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:61)
    at com.intellij.openapi.options.ex.ConfigurableCardPanel.createConfigurableComponent(ConfigurableCardPanel.java:105)
    at com.intellij.openapi.options.ex.ConfigurableCardPanel.lambda$create$0(ConfigurableCardPanel.java:54)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:894)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:61)
    at com.intellij.openapi.options.ex.ConfigurableCardPanel.create(ConfigurableCardPanel.java:53)
    at com.intellij.openapi.options.newEditor.ConfigurableEditor$1.create(ConfigurableEditor.java:51)
    at com.intellij.openapi.options.newEditor.ConfigurableEditor$1.create(ConfigurableEditor.java:48)
    at com.intellij.ui.CardLayoutPanel.createValue(CardLayoutPanel.java:73)
    at com.intellij.ui.CardLayoutPanel.select(CardLayoutPanel.java:101)
    at com.intellij.ui.CardLayoutPanel.lambda$null$0(CardLayoutPanel.java:117)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
    at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:310)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:80)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:128)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
    at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:184)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:974)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:847)
    at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:449)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:730)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:496)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
    at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
    at java.awt.Dialog.show(Dialog.java:1077)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:708)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:437)
    at com.intellij.openapi.ui.DialogWrapper.doShow(DialogWrapper.java:1685)
    at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1644)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:124)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:97)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:89)
    at com.android.tools.idea.updater.configure.RunSdkConfigAction.actionPerformed(RunSdkConfigAction.java:75)
    at com.android.tools.idea.sdk.wizard.SdkQuickfixUtils.showAndroidSdkManager(SdkQuickfixUtils.java:137)
    at com.android.tools.idea.sdk.wizard.SdkQuickfixUtils.showSdkMissingDialog(SdkQuickfixUtils.java:132)
    at com.android.tools.idea.actions.AndroidNewProjectAction.actionPerformed(AndroidNewProjectAction.kt:41)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:280)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.invokeAction(ActionUtil.java:443)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.invokeAction(ActionUtil.java:428)
    at com.intellij.ui.components.labels.ActionLink$1.linkSelected(ActionLink.java:46)
    at com.intellij.ui.components.labels.LinkLabel.doClick(LinkLabel.java:143)
    at com.intellij.ui.components.labels.ActionLink.doClick(ActionLink.java:55)
    at com.intellij.ui.components.labels.LinkLabel$MyMouseHandler.mouseReleased(LinkLabel.java:331)
    at java.awt.Component.processMouseEvent(Component.java:6550)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3325)
    at java.awt.Component.processEvent(Component.java:6315)
    at java.awt.Container.processEvent(Container.java:2239)
    at java.awt.Component.dispatchEventImpl(Component.java:4899)
    at java.awt.Container.dispatchEventImpl(Container.java:2297)
    at java.awt.Component.dispatchEvent(Component.java:4721)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
    at java.awt.Container.dispatchEventImpl(Container.java:2283)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4721)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:766)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
    at java.awt.EventQueue$4.run(EventQueue.java:739)
    at java.awt.EventQueue$4.run(EventQueue.java:737)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:736)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:974)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:912)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:844)
    at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:449)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:741)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    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)

之后,如果我点击 “nexproject”,我会收到 “您的 Android SDK 丢失、过期或损坏。” Error message

我尝试了一整天,但现在,我真的迷路了...... 请问你能帮我吗? 你会拯救我的周末。

我已经安装了 jdk-17。 这是我的配置:AMD Ryzen 7 5800X 8-Core Processor 3.80 GHz 64 位,处理器 x64 Windows 10

【问题讨论】:

【参考方案1】:

你并不孤单……大约 4 小时前,我决定在北极狐的通知中点击更新按钮。我已经卸载并重新安装了好几次。在此过程中,我注意到 Android Studio 4.2 将安装并运行。但不是北极狐。

【讨论】:

我刚刚尝试了 4.2,但我有相同的屏幕,但没有内部错误。只是“启动失败” 经过多次重新安装后,我的问题得到了解决。在某个时候(当它仍在工作时),我更改了 SDK 安装点。我已经删除了。在删除它之前,我有 4 个错误,而不仅仅是 1 个。无论如何,我在我的环境变量(Windows 10)中找到了对该文件夹的引用。我删除了它,以及我在每次重新安装时一直删除的所有其他用户文件。然后重新安装,终于又开心了。我是 Android Studio 的新手,到目前为止,似乎到处都是仙尘和魔法。我希望你能找到你的小鬼!!! 为你高兴。我创建了一个新的本地帐户。和android工作室工作。也许像你一样,变量路径有问题。我不知道。好吧,我有我的解决方案。

以上是关于无法启动 Android Studio的主要内容,如果未能解决你的问题,请参考以下文章

无法启动 Android Studio

Android Studio:无法启动守护进程

Android Studio:无法启动活动组件信息

无法在 Linux 中启动 Android Studio

Android studio 修改了 android:background=“@drawable/welcome“后无法启动

无法在 Android Studio 中启动模拟器