Anko: Anko Support Plugin v0.10.4

Created on 30 Dec 2017  路  6Comments  路  Source: Kotlin/anko

After installing the latest version of Anko Support Plugin for Android Studio, IDE reported about the error:

org.jetbrains.kotlin.android.dslpreview.LayoutPsiFile cannot be cast to com.intellij.openapi.util.UserDataHolderEx

And after that, I can't type any line of code in the workspace with classes containing the code of _AnkoComponent_, while I didn't disable or uninstall Anko Support Plugin. On Previous version 0.10.3, all has been work well
screenshot_1

bug critical

Most helpful comment

Could you try this hotfix build? (Click "Login as guest")
https://teamcity.jetbrains.com/repository/download/ProjectsWrittenInKotlin_Anko/1288995:id/anko-ide-plugin.zip

All 6 comments

Same problem here :(

Below is the stack trace:

org.jetbrains.kotlin.android.dslpreview.LayoutPsiFile cannot be cast to com.intellij.openapi.util.UserDataHolderEx
java.lang.ClassCastException: org.jetbrains.kotlin.android.dslpreview.LayoutPsiFile cannot be cast to com.intellij.openapi.util.UserDataHolderEx
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil.getCachedInjectedDocuments(InjectedLanguageUtil.java:436)
    at com.intellij.codeInsight.editorActions.TypedHandler.injectedEditorIfCharTypedIsSignificant(TypedHandler.java:341)
    at com.intellij.codeInsight.editorActions.BackspaceHandler.handleBackspace(BackspaceHandler.java:82)
    at com.intellij.codeInsight.editorActions.BackspaceHandler.executeWriteAction(BackspaceHandler.java:62)
    at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:50)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1023)
    at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.doExecute(EditorWriteActionHandler.java:63)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler$3$1.perform(EditorActionHandler.java:206)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:109)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.access$000(EditorActionHandler.java:38)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler$3.perform(EditorActionHandler.java:203)
    at com.intellij.openapi.editor.impl.CaretModelImpl.lambda$runForEachCaret$2(CaretModelImpl.java:364)
    at com.intellij.openapi.editor.impl.CaretModelImpl.doWithCaretMerging(CaretModelImpl.java:453)
    at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:356)
    at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:347)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:200)
    at com.intellij.codeInsight.lookup.impl.BackspaceHandler.doExecute(BackspaceHandler.java:38)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler$4.perform(EditorActionHandler.java:217)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:109)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:214)
    at com.intellij.openapi.editor.actionSystem.EditorAction.lambda$actionPerformed$0(EditorAction.java:98)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:149)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:109)
    at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:107)
    at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:86)
    at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:215)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:232)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:570)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.lambda$processAction$2(IdeKeyEventDispatcher.java:619)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:193)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:618)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:477)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:211)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:633)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365)
    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)


pluginDeclarationProviderFactory
On failure:
-no synthetic files-
On creation:
-no synthetic files-

    at org.jetbrains.kotlin.idea.project.IdeaAbsentDescriptorHandler.diagnoseDescriptorNotFound(IdeaLocalDescriptorResolver.kt:44)
    at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver.resolveToDescriptor(LazyDeclarationResolver.kt:91)
    at org.jetbrains.kotlin.resolve.lazy.ResolveSession.resolveToDescriptor(ResolveSession.java:331)
    at org.jetbrains.kotlin.idea.project.ResolveElementCache.resolveToElements(ResolveElementCache.kt:216)
    at org.jetbrains.kotlin.idea.caches.resolve.ResolutionFacadeImpl.analyze(ResolutionFacadeImpl.kt:59)
    at org.jetbrains.kotlin.idea.caches.resolve.ResolutionFacadeImpl.analyze(ResolutionFacadeImpl.kt:53)
    at org.jetbrains.kotlin.idea.caches.resolve.ResolutionUtils.analyze(resolutionApi.kt:82)
    at org.jetbrains.kotlin.idea.caches.resolve.ResolutionUtils.resolveToDescriptorIfAny(resolutionApi.kt:61)
    at org.jetbrains.kotlin.idea.caches.resolve.ResolutionUtils.resolveToDescriptorIfAny$default(resolutionApi.kt:59)
    at org.jetbrains.kotlin.idea.core.PsiModificationUtilsKt.getModalityFromDescriptor(psiModificationUtils.kt:274)
    at org.jetbrains.kotlin.idea.core.PsiModificationUtilsKt.isInheritable(psiModificationUtils.kt:245)
    at org.jetbrains.kotlin.idea.core.PsiModificationUtilsKt.isOverridable(psiModificationUtils.kt:260)
    at org.jetbrains.kotlin.idea.highlighter.markers.KotlinLineMarkerProviderKt.collectOverriddenFunctions(KotlinLineMarkerProvider.kt:353)
    at org.jetbrains.kotlin.idea.highlighter.markers.KotlinLineMarkerProviderKt.access$collectOverriddenFunctions(KotlinLineMarkerProvider.kt:1)
    at org.jetbrains.kotlin.idea.highlighter.markers.KotlinLineMarkerProvider.collectSlowLineMarkers(KotlinLineMarkerProvider.kt:105)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.queryProviders(LineMarkersPass.java:209)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.lambda$doCollectInformation$3(LineMarkersPass.java:111)
    at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:96)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:106)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:438)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1156)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:431)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:430)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:406)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:142)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:242)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:404)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:165)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

same problem
org.jetbrains.kotlin.android.dslpreview.LayoutPsiFile cannot be cast to com.intellij.openapi.util.UserDataHolderEx java.lang.ClassCastException: org.jetbrains.kotlin.android.dslpreview.LayoutPsiFile cannot be cast to com.intellij.openapi.util.UserDataHolderEx at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil.getCachedInjectedDocuments(InjectedLanguageUtil.java:436) at com.intellij.codeInsight.editorActions.TypedHandler.injectedEditorIfCharTypedIsSignificant(TypedHandler.java:341) at com.intellij.codeInsight.editorActions.BackspaceHandler.handleBackspace(BackspaceHandler.java:82) at com.intellij.codeInsight.editorActions.BackspaceHandler.executeWriteAction(BackspaceHandler.java:62) at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:50) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1023) at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.doExecute(EditorWriteActionHandler.java:63) at com.intellij.openapi.editor.actionSystem.EditorActionHandler$3$1.perform(EditorActionHandler.java:206) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:109) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.access$000(EditorActionHandler.java:38) at com.intellij.openapi.editor.actionSystem.EditorActionHandler$3.perform(EditorActionHandler.java:203) at com.intellij.openapi.editor.impl.CaretModelImpl.lambda$runForEachCaret$2(CaretModelImpl.java:364) at com.intellij.openapi.editor.impl.CaretModelImpl.doWithCaretMerging(CaretModelImpl.java:453) at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:356) at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:347) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:200) at com.intellij.codeInsight.lookup.impl.BackspaceHandler.doExecute(BackspaceHandler.java:38) at com.intellij.openapi.editor.actionSystem.EditorActionHandler$4.perform(EditorActionHandler.java:217) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:109) at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:214) at com.intellij.openapi.editor.actionSystem.EditorAction.lambda$actionPerformed$0(EditorAction.java:98) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:149) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:109) at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:107) at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:86) at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:215) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:232) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:570) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.lambda$processAction$2(IdeKeyEventDispatcher.java:619) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:193) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:618) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:477) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:211) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:633) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365) 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)

the only way to solve it is to deactivate anko support for the moment, otherwise it does not allow modifying kotlin files

Could you try this hotfix build? (Click "Login as guest")
https://teamcity.jetbrains.com/repository/download/ProjectsWrittenInKotlin_Anko/1288995:id/anko-ide-plugin.zip

great, solved the problem that did not allow me to edit any kotlin file and anko layout preview working excellent, many thanks
test-editing-kotlin-file

I was getting the same issue, and the hotfix works for me as well.

thanks for the fix, works for me as well!

Was this page helpful?
0 / 5 - 0 ratings