无法启动 Android Studio

无法启动 Android Studio

最近我在使用 Android Studio 时遇到了一些问题(Gradle 无法同步、无法定位 JDK 等)。因此,我完全卸载并重新安装了 Android Studio 和 JDK。但现在,当我尝试启动它时,启动画面会加载,然后我会看到此消息

Internal error. Please report to https://code.google.com/p/android/issues

java.lang.RuntimeException: com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing 'com.android.tools.idea.AndroidInitialConfigurator'
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:212)
at com.intellij.idea.MainImpl$1.lambda$null$0(MainImpl.java:49)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:380)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing 'com.android.tools.idea.AndroidInitialConfigurator'
at com.intellij.ide.plugins.PluginManager.handleComponentError(PluginManager.java:257)
at com.intellij.openapi.components.impl.PlatformComponentManagerImpl.handleInitComponentError(PlatformComponentManagerImpl.java:43)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:501)
at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:106)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$createComponents$9(ApplicationImpl.java:437)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
at com.intellij.openapi.application.impl.ApplicationImpl.createComponents(ApplicationImpl.java:444)
at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:90)
at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:396)
at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:382)
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:205)
... 15 more
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:157)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:76)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:82)
at org.jetbrains.android.sdk.AndroidSdkData.<init>(AndroidSdkData.java:139)
at org.jetbrains.android.sdk.AndroidSdkData.getSdkData(AndroidSdkData.java:104)
at org.jetbrains.android.sdk.AndroidSdkData.getSdkData(AndroidSdkData.java:78)
at org.jetbrains.android.sdk.AndroidSdkData.getSdkData(AndroidSdkData.java:112)
at org.jetbrains.android.sdk.AndroidSdkData.getSdkData(AndroidSdkData.java:119)
at org.jetbrains.android.sdk.AndroidPlatform.parse(AndroidPlatform.java:86)
at org.jetbrains.android.sdk.AndroidSdkAdditionalData.getAndroidPlatform(AndroidSdkAdditionalData.java:137)
at org.jetbrains.android.sdk.AndroidPlatform.getInstance(AndroidPlatform.java:68)
at com.android.tools.idea.sdk.IdeSdks.getEligibleAndroidSdks(IdeSdks.java:591)
at com.android.tools.idea.sdk.IdeSdks.getFirstAndroidSdk(IdeSdks.java:191)
at com.android.tools.idea.sdk.IdeSdks.getAndroidSdkPath(IdeSdks.java:117)
at com.android.tools.idea.startup.GradleSpecificInitializer.setupSdks(GradleSpecificInitializer.java:283)
at com.android.tools.idea.startup.GradleSpecificInitializer.run(GradleSpecificInitializer.java:116)
at com.android.tools.idea.AndroidInitialConfigurator.activateAndroidStudioInitializerExtensions(AndroidInitialConfigurator.java:206)
at com.android.tools.idea.AndroidInitialConfigurator.<init>(AndroidInitialConfigurator.java:72)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.picocontainer.defaults.InstantiatingComponentAdapter.newInstance(InstantiatingComponentAdapter.java:193)
at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.doGetComponentInstance(CachingConstructorInjectionComponentAdapter.java:103)
at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.instantiateGuarded(CachingConstructorInjectionComponentAdapter.java:80)
at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.getComponentInstance(CachingConstructorInjectionComponentAdapter.java:63)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:459)
... 27 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema PluginClassLoader[org.jetbrains.android, 10.3.2.1] com.intellij.ide.plugins.cl.PluginClassLoader@e5e4d0b
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:63)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 54 more

笔记:我安装了 JDK 11.0.1 和 IntelliJ IDEA 以及 Android Studio

答案1

Android Studio 与 Java 11 不兼容。您需要安装 Java 8 并使用 JDK 8。

答案2

我通过重新安装 Android Studio 解决了这个问题。但我不知道是什么导致了这个问题。

相关内容