Android Studio 3.1 Canary 3 can';t see ANko Preview #506
Comments
Same here with AS 3.0.0 |
Any logged exceptions? |
Same for 3.0. I get an "Anko Support threw an uncaught NoClassDefFoundError" and the preview view is grey with only the text "__anko.preview.View" in it. |
@DFreds Could you please post stacktrace? It should be available via red icon in bottom-right corner after exception happened. |
@4u7 do you mean this? |
This issue is related to Kotlin 1.1.6+, fixed plugin will be published soon |
exception fixed with 3367ad5 |
Preview should work normally with upcoming AS 3.1 Canary 5 update, otherwise feel free to reopen. |
I follow your instruction and search "Convert to Anko Layout DSL" , can't find |
How to solve it |
Thanks 4u7 @4u7 |
I install latest Anko Support and
declare as below
class MyActivityUI : AnkoComponent {
override fun createView(ui: AnkoContext) = ui.apply {
verticalLayout {
val name = editText()
button("Say Hello") {
onClick { ctx.toast("Hello, ${name.text}!") }
}
}
}.view
}
class IEOverViewActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener {
Still , View > Tool Windows can't see Anko Preview / Anko Support Preview
please tell me what to do, thanks.
The text was updated successfully, but these errors were encountered: