paparazzi
paparazzi copied to clipboard
Error inflating view that uses DataBinding
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
@danielgomesoliveira I know you provided the repro steps above (thank you!), but would you mind providing a link to a project repo with data binding enabled?
@jrodbx thank you for the quick answer. I prepared a small repo where this can be reproduced here.
Let me know if you need any other information