title: How to resolve an IDE error in Android Studio?
body: <p>I have a problem with Android Studio 3.2.1. The IDE error appears when I want to add onClick Event Handler. It also doesn't create a function. I tried to do this: <a href="https://www.quora.com/How-can-I-resolve-an-IDE-error-in-Android-Studio" rel="nofollow noreferrer">https://www.quora.com/How-can-I-resolve-an-IDE-error-in-Android-Studio</a>
  and also I tried to reinstall, but it didn't help.
  Here are my error details and some screenshots:
  <a href="https://i.stack.imgur.com/J2p1h.png" rel="nofollow noreferrer">Add onClick Event Handler</a> </p>
  
  <pre><code>    org.jetbrains.kotlin.asJava.classes.KtLightClassImpl
      com.intellij.util.IncorrectOperationException: org.jetbrains.kotlin.asJava.classes.KtLightClassImpl
  at com.intellij.psi.impl.light.LightElement.add(LightElement.java:139)
  at org.jetbrains.android.dom.AndroidCreateOnClickHandlerAction.addHandlerMethod(AndroidCreateOnClickHandlerAction.java:152)
  at org.jetbrains.android.dom.AndroidCreateOnClickHandlerAction.lambda$addHandlerMethodAndNavigate$2(AndroidCreateOnClickHandlerAction.java:170)
  at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1010)
  at org.jetbrains.android.dom.AndroidCreateOnClickHandlerAction.addHandlerMethodAndNavigate(AndroidCreateOnClickHandlerAction.java:169)
  at org.jetbrains.android.dom.AndroidCreateOnClickHandlerAction.invoke(AndroidCreateOnClickHandlerAction.java:124)
  at com.intellij.codeInsight.intention.impl.config.IntentionActionWrapper.invoke(IntentionActionWrapper.java:67)
  at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.invoke(IntentionActionWithTextCaching.java:181)
  at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$invokeIntention$3(ShowIntentionActionsHandler.java:211)
  at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.invokeIntention(ShowIntentionActionsHandler.java:215)
  at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$null$1(ShowIntentionActionsHandler.java:188)
  at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
  at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:153)
  at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$chooseActionAndInvoke$2(ShowIntentionActionsHandler.java:187)
  at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:137)
  at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:95)
  at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:85)
  at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:71)
  at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.chooseActionAndInvoke(ShowIntentionActionsHandler.java:186)
  at com.intellij.codeInsight.intention.impl.IntentionListStep.lambda$applyAction$1(IntentionListStep.java:278)
  at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:195)
  at com.intellij.ui.popup.AbstractPopup.lambda$dispose$8(AbstractPopup.java:1398)
  at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2886)
  at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:179)
  at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:138)
  at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:190)
  at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:56)
  at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1392)
  at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:160)
  at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:307)
  at com.intellij.openapi.util.Disposer$1.execute(Disposer.java:48)
  at com.intellij.openapi.util.Disposer$1.execute(Disposer.java:44)
  at com.intellij.openapi.util.objectTree.ObjectNode$1.execute(ObjectNode.java:138)
  at com.intellij.openapi.util.objectTree.ObjectNode$1.execute(ObjectNode.java:107)
  at com.intellij.openapi.util.objectTree.ObjectTree.executeActionWithRecursiveGuard(ObjectTree.java:169)
  at com.intellij.openapi.util.objectTree.ObjectNode.execute(ObjectNode.java:107)
  at com.intellij.openapi.util.objectTree.ObjectTree.executeAll(ObjectTree.java:144)
  at com.intellij.openapi.util.Disposer.dispose(Disposer.java:129)
  at com.intellij.openapi.util.Disposer.dispose(Disposer.java:125)
  at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:263)
  at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:442)
  at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:396)
  at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:342)
  at com.intellij.ui.popup.list.ListPopupImpl$MyMouseListener.mouseReleased(ListPopupImpl.java:501)
  at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
  at java.awt.Component.processMouseEvent(Component.java:6548)
  at javax.swing.JComponent.processMouseEvent(JComponent.java:3325)
  at com.intellij.ui.popup.list.ListPopupImpl$MyList.processMouseEvent(ListPopupImpl.java:552)
  at java.awt.Component.processEvent(Component.java:6313)
  at java.awt.Container.processEvent(Container.java:2237)
  at java.awt.Component.dispatchEventImpl(Component.java:4903)
  at java.awt.Container.dispatchEventImpl(Container.java:2295)
  at java.awt.Component.dispatchEvent(Component.java:4725)
  at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
  at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
  at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
  at java.awt.Container.dispatchEventImpl(Container.java:2281)
  at java.awt.Window.dispatchEventImpl(Window.java:2746)
  at java.awt.Component.dispatchEvent(Component.java:4725)
  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:80)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
  at java.awt.EventQueue$4.run(EventQueue.java:737)
  at java.awt.EventQueue$4.run(EventQueue.java:735)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
  at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
  at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
  at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:759)
  at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
  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)
  </code></pre>