Android Studio – How to generate the preview of a custom view that uses a ViewModelProvider?
Android Studio stopped generating the preview of my layout. The problem is caused by the presence of custom views. The error : Render Problem java.lang.NullPointerException at com.my.app.views.bars.TopBar$mainViewModel$2.invoke(TopBar.kt:26) at com.my.app.views.bars.TopBar$mainViewModel$2.invoke(TopBar.kt:25) at layoutlib.internal.kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) The problem seems to come from the ViewModelProvider :…