question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When using anko DSL the stepper view crashes when inflating the xml.

Error: android.view.InflateException: Binary XML file line #10: Error inflating class com.stepstone.stepper.internal.widget.TabsContainer

How to reproduce:

  1. Write an extension for the stepper layout
inline fun ViewManager.stepperLayout(theme: Int = 0) = stepperLayout(theme) {}
inline fun ViewManager.stepperLayout(theme: Int = 0, init: StepperLayout.() -> Unit) = ankoView({ StepperLayout(it) }, theme, init)
  1. In your activity add the DSL code
verticalLayout {
    stepperLayout {  }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pauliusrumcommented, May 9, 2017

however I noticed you’re missing the ‘type’ attribute which is required.

Yes, that’s the problem. Now the only way to set it is through XML attributes. Would it be possible to make an additional constructor which takes the ‘type’ instead of AttributeSet object (since this is only used for XML and implementing the interface for regular use would not be efficient), because anko DSL builds the UI programmatically not through XML inflators. I could make a PR for that.

0reactions
seaskywayscommented, May 15, 2017

What i ended up doing is having the stepper alone in xml, and include it in my layout DSL

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dsl processing error (UNKNOWN): Unable to find message ...
When I try to refresh DSL Preview in Activity with layout defined in anko DSL I receive following error: I'm using: IntelliJ IDEA...
Read more >
Getting an IDE Error with Anko Layout Preview - Stack Overflow
I'm getting the following IDE error when opening the Anko Layout Preview tool window. The full code of my toy project is below...
Read more >
Reviews: Anko Support - IntelliJ IDEA & Android Studio Plugin
After Android Studio updated to 3.3,the anko support 0.10.7-2 can't work. ... Plugin 'Anko DSL Preview' is incompatible with this installation (Android 2.4 ......
Read more >
Anko custom widget: editText without displaying error text-kotlin
I believe you want to make your View class accessible from the DSL, and then create it explicitly. Add this code to the...
Read more >
Write better Kotlin: Getting Started with Anko for Android
Layouts: provides a Domain Specific Language (DSL) for defining Android ... More code also means more opportunities for error — there's ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found