Thread
#android-studio
    Brady Aiello

    Brady Aiello

    2 years ago
    AS 4.2 Canary 9 emulator issues I'm having: Can't open AVD Manager Can't start an emulator Disabled "Launch in a Tool Window", but the emulator tool window still shows up
    java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
    	at java.lang.ClassLoader.defineClass1(Native Method)
    	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
    	at java.lang.ClassLoader.defineClass(ClassLoader.java:635)
    	at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:419)
    	at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:411)
    	at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:369)
    	at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:355)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    	at org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown Source)
    	at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source)
    	at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)
    	at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source)
    	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    	at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
    	at com.android.dvlib.DeviceSchema.getXmlSchemaVersion(DeviceSchema.java:398)
    	at com.android.sdklib.devices.DeviceParser.parseImpl(DeviceParser.java:496)
    	at com.android.sdklib.devices.DeviceParser.parse(DeviceParser.java:481)
    	at com.android.sdklib.devices.DeviceManager.initDefaultDevices(DeviceManager.java:287)
    	at com.android.sdklib.devices.DeviceManager.initDevicesLists(DeviceManager.java:265)
    	at com.android.sdklib.devices.DeviceManager.getDevice(DeviceManager.java:198)
    	at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1451)
    	at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1337)
    	at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:402)
    	at com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:443)
    	at com.android.tools.idea.avdmanager.AvdManagerConnection.initIfNecessary(AvdManagerConnection.java:211)
    	at com.android.tools.idea.avdmanager.AvdManagerConnection.getAvds(AvdManagerConnection.java:333)
    	at com.android.tools.idea.avdmanager.AvdDisplayList.refreshAvds(AvdDisplayList.java:230)
    	at com.android.tools.idea.avdmanager.AvdDisplayList.<init>(AvdDisplayList.java:194)
    	at com.android.tools.idea.avdmanager.AvdListDialog.<init>(AvdListDialog.java:43)
    	at org.jetbrains.android.actions.RunAndroidAvdManagerAction.openAvdManager(RunAndroidAvdManagerAction.java:74)
    	at org.jetbrains.android.actions.RunAndroidAvdManagerAction.actionPerformed(RunAndroidAvdManagerAction.java:65)
    	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:282)
    	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:276)
    	at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:182)
    	at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:155)
    	at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:439)
    	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:967)
    	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:904)
    	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:836)
    	at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:450)
    	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:744)
    	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:449)
    	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
    	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:503)
    	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)
    Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
    	at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:357)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    	... 78 more
    I've tried everything. I reinstalled HAXM, rolled back to earlier releases, installed AS it as a standalone app from the website instead of from Jetbrains Toolbox. Getting this stacktrace:
    I actually fixed this by changing the Java runtime version using "Choose Runtime", and selecting one of the stable Jetbrains JRE's for Java 11.