Android Studio 3.3.1,Anko支持0.10.7:在没有预览的情况下出现灰屏

时间:2019-03-04 15:11:28

标签: android anko anko-component

使用此配置,我看不到Anko Preview的任何预览,只有灰色屏幕。救命,我被封锁了!

我使用了太多的Anko Library 0.10。*,但它不起作用,我的预览只有灰色,截止日期不远,我在这个问题上待了一个星期,求助!如果任何人都有一个很好的解决方案。

屏幕截图:

enter image description here

我的堆栈跟踪:

java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.jetbrains.kotlin.android.dslpreview.DslPreviewClassResolver$Companion.createTypeMapper(DslPreviewClassResolver.kt:131)
at org.jetbrains.kotlin.android.dslpreview.DslPreviewClassResolver$Companion.access$createTypeMapper(DslPreviewClassResolver.kt:122)
at org.jetbrains.kotlin.android.dslpreview.DslPreviewClassResolver.resolveClassDescription(DslPreviewClassResolver.kt:116)
at org.jetbrains.kotlin.android.dslpreview.DslPreviewClassResolver.getAncestors(DslPreviewClassResolver.kt:74)
at org.jetbrains.kotlin.android.dslpreview.AnkoNlPreviewManager.resolveAvailableClasses(AnkoNlPreviewManager.kt:167)
at org.jetbrains.kotlin.android.dslpreview.AnkoNlPreviewManager.initToolWindow(AnkoNlPreviewManager.kt:156)
at com.android.tools.idea.uibuilder.editor.NlPreviewManager$2.run(NlPreviewManager.java:272)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327)
at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:277)
at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:3115)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:288)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:246)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:232)
at com.intellij.util.Alarm$Request.runSafely(Alarm.java:405)
at com.intellij.util.Alarm$Request.access$700(Alarm.java:330)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:371)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:447)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:431)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:415)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
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.awt.EventQueue.dispatchEvent(EventQueue.java:732)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:817)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:758)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:394)
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)

1 个答案:

答案 0 :(得分:0)

我删除了 Android Studio 3.3.1 ,并安装了 AS 3.2 (包括 kotlin 1.2.71 )+“ ext。 gradle文件中的anko_version ='0.10.7'。 之后,一切正常。