Skip to content

Error inflating view that uses DataBinding #1016

@danielgomesoliveira

Description

@danielgomesoliveira

Description
I've been trying to write a simple test for a view that uses data binding (root is layout), but I keep getting the error

Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class layout
Caused by: java.lang.ClassNotFoundException: onCreateView
...
Caused by: java.lang.ClassNotFoundException: layout

On the project sample I can see examples using View Binding, but not Data Binding.

Steps to Reproduce
Try to inflate a view with Data Binding

@Test
fun testDefaultBinding() { 
    val view = FragmentBinding.inflate(paparazzi.layoutInflater)
    paparazzi.snapshot(view.root)
}

Expected behavior
Test runs normally

Additional information:

  • Paparazzi Version: 1.3.1
  • OS: Mac OS
  • Compile SDK: 33
  • Gradle Version: 8.0.2
  • Android Gradle Plugin Version: 8.0.2

Screenshots
N\A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions