New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Studio 3.0 Anko Support Plugin Error #503

Closed
yaosongqwe opened this Issue Nov 9, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@yaosongqwe

yaosongqwe commented Nov 9, 2017

Plugin Error: Anko Support threw an uncaught NoClassDefFoundError. Disable Plugin

@yaosongqwe

This comment has been minimized.

Show comment
Hide comment
@yaosongqwe

yaosongqwe Nov 9, 2017

anko_version = '0.10.2'
kotlin_version = '1.1.51'

yaosongqwe commented Nov 9, 2017

anko_version = '0.10.2'
kotlin_version = '1.1.51'

@yaosongqwe

This comment has been minimized.

Show comment
Hide comment
@yaosongqwe

yaosongqwe Nov 9, 2017

Plugin version is also 0.10.2

yaosongqwe commented Nov 9, 2017

Plugin version is also 0.10.2

@yaosongqwe

This comment has been minimized.

Show comment
Hide comment
@yaosongqwe

yaosongqwe Nov 9, 2017

when preview activity's UI:
The following classes could not be found:
- __anko.preview.View (Change to android.media.tv.TvView, Fix Build Path, Edit XML, Create Class)

yaosongqwe commented Nov 9, 2017

when preview activity's UI:
The following classes could not be found:
- __anko.preview.View (Change to android.media.tv.TvView, Fix Build Path, Edit XML, Create Class)

@4u7

This comment has been minimized.

Show comment
Hide comment
@4u7

4u7 Nov 9, 2017

Contributor

@yaosongqwe Could you post stacktrace of the exception?

Contributor

4u7 commented Nov 9, 2017

@yaosongqwe Could you post stacktrace of the exception?

@yaosongqwe

This comment has been minimized.

Show comment
Hide comment
@yaosongqwe

yaosongqwe Nov 10, 2017

sorry,the error just said so,
when I try to use Anko Layout preview.

yaosongqwe commented Nov 10, 2017

sorry,the error just said so,
when I try to use Anko Layout preview.

@ivankolev

This comment has been minimized.

Show comment
Hide comment
@ivankolev

ivankolev Nov 13, 2017

Can confirm, the same happens to me. Here's the stack trace:
2017-11-13 15:34:04,797 [ thread 72] ERROR - plication.impl.ApplicationImpl - Access is allowed from event dispatch thread only. com.intellij.diagnostic.LogEventException: Access is allowed from event dispatch thread only. at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1112) at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1101) at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.assertDispatchThread(FileEditorManagerImpl.java:1513) at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.getSelectedTextEditor(FileEditorManagerImpl.java:1196) at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.getSelectedTextEditor(FileEditorManagerImpl.java:1191) at org.jetbrains.kotlin.android.dslpreview.DslPreviewClassResolver.getOnCursorPreviewClassDescription(DslPreviewClassResolver.kt:47) at org.jetbrains.kotlin.android.dslpreview.AnkoNlPreviewManager.refresh(AnkoNlPreviewManager.kt:129) at org.jetbrains.kotlin.android.dslpreview.AnkoNlPreviewManager.access$refresh(AnkoNlPreviewManager.kt:40) at org.jetbrains.kotlin.android.dslpreview.AnkoNlPreviewManager$2.execute(AnkoNlPreviewManager.kt:73) at com.android.tools.idea.gradle.project.build.invoker.GradleTasksExecutorImpl.lambda$showGradleOutput$4(GradleTasksExecutorImpl.java:472) at com.intellij.openapi.util.ExecutionCallback.setExecuted(ExecutionCallback.java:58) at com.intellij.openapi.util.ActionCallback.setDone(ActionCallback.java:72) at com.android.tools.idea.gradle.project.build.invoker.GradleTasksExecutorImpl.lambda$collectMessages$5(GradleTasksExecutorImpl.java:489) at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 2017-11-13 15:34:04,799 [ thread 72] ERROR - plication.impl.ApplicationImpl - Android Studio 3.0 Build #AI-171.4408382 2017-11-13 15:34:04,799 [ thread 72] ERROR - plication.impl.ApplicationImpl - JDK: 1.8.0_152-release 2017-11-13 15:34:04,799 [ thread 72] ERROR - plication.impl.ApplicationImpl - VM: OpenJDK 64-Bit Server VM 2017-11-13 15:34:04,799 [ thread 72] ERROR - plication.impl.ApplicationImpl - Vendor: JetBrains s.r.o 2017-11-13 15:34:04,799 [ thread 72] ERROR - plication.impl.ApplicationImpl - OS: Windows 10 2017-11-13 15:34:04,799 [ thread 72] ERROR - plication.impl.ApplicationImpl - Last Action:

ivankolev commented Nov 13, 2017

Can confirm, the same happens to me. Here's the stack trace:
2017-11-13 15:34:04,797 [ thread 72] ERROR - plication.impl.ApplicationImpl - Access is allowed from event dispatch thread only. com.intellij.diagnostic.LogEventException: Access is allowed from event dispatch thread only. at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1112) at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1101) at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.assertDispatchThread(FileEditorManagerImpl.java:1513) at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.getSelectedTextEditor(FileEditorManagerImpl.java:1196) at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.getSelectedTextEditor(FileEditorManagerImpl.java:1191) at org.jetbrains.kotlin.android.dslpreview.DslPreviewClassResolver.getOnCursorPreviewClassDescription(DslPreviewClassResolver.kt:47) at org.jetbrains.kotlin.android.dslpreview.AnkoNlPreviewManager.refresh(AnkoNlPreviewManager.kt:129) at org.jetbrains.kotlin.android.dslpreview.AnkoNlPreviewManager.access$refresh(AnkoNlPreviewManager.kt:40) at org.jetbrains.kotlin.android.dslpreview.AnkoNlPreviewManager$2.execute(AnkoNlPreviewManager.kt:73) at com.android.tools.idea.gradle.project.build.invoker.GradleTasksExecutorImpl.lambda$showGradleOutput$4(GradleTasksExecutorImpl.java:472) at com.intellij.openapi.util.ExecutionCallback.setExecuted(ExecutionCallback.java:58) at com.intellij.openapi.util.ActionCallback.setDone(ActionCallback.java:72) at com.android.tools.idea.gradle.project.build.invoker.GradleTasksExecutorImpl.lambda$collectMessages$5(GradleTasksExecutorImpl.java:489) at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 2017-11-13 15:34:04,799 [ thread 72] ERROR - plication.impl.ApplicationImpl - Android Studio 3.0 Build #AI-171.4408382 2017-11-13 15:34:04,799 [ thread 72] ERROR - plication.impl.ApplicationImpl - JDK: 1.8.0_152-release 2017-11-13 15:34:04,799 [ thread 72] ERROR - plication.impl.ApplicationImpl - VM: OpenJDK 64-Bit Server VM 2017-11-13 15:34:04,799 [ thread 72] ERROR - plication.impl.ApplicationImpl - Vendor: JetBrains s.r.o 2017-11-13 15:34:04,799 [ thread 72] ERROR - plication.impl.ApplicationImpl - OS: Windows 10 2017-11-13 15:34:04,799 [ thread 72] ERROR - plication.impl.ApplicationImpl - Last Action:

@ivankolev

This comment has been minimized.

Show comment
Hide comment
@ivankolev

ivankolev Nov 14, 2017

Ok, so the problem seems to be that we are not implementing an AnkoComponent, as outlined here:
https://github.com/Kotlin/anko/wiki/Anko-Layouts#anko-support-plugin
When I followed the steps there, the preview works properly.

ivankolev commented Nov 14, 2017

Ok, so the problem seems to be that we are not implementing an AnkoComponent, as outlined here:
https://github.com/Kotlin/anko/wiki/Anko-Layouts#anko-support-plugin
When I followed the steps there, the preview works properly.

@yaosongqwe

This comment has been minimized.

Show comment
Hide comment
@yaosongqwe

yaosongqwe Nov 14, 2017

@ivankolev
Thank you very much.
I have solved that by your way, and then i preview my DSL layout successfully.

yaosongqwe commented Nov 14, 2017

@ivankolev
Thank you very much.
I have solved that by your way, and then i preview my DSL layout successfully.

@yaosongqwe yaosongqwe closed this Nov 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment