Autobind when there is no default ViewModel
in our android and iOS apps we have a setup where we load different remote rive animations
Those rives can have an internally used viewModel, which is used for animaiton logic and user interaction, but some are a pure animation without even a view model.
For the first ones to work, I have to use autobind:
builder.setAutoBind(true)but then the second type, which has no view model crashes:
app.rive.runtime.kotlin.core.errors.ViewModelException: No default ViewModel found for artboard main.
at app.rive.runtime.kotlin.core.File.defaultViewModelForArtboard(File.kt:234)
at app.rive.runtime.kotlin.controllers.RiveFileController.setupScene$kotlin_release(RiveFileController.kt:451)
at app.rive.runtime.kotlin.RiveAnimationView$onAttachedToWindow$1.invoke(RiveAnimationView.kt:961)
at app.rive.runtime.kotlin.RiveAnimationView$onAttachedToWindow$1.invoke(RiveAnimationView.kt:959)
at app.rive.runtime.kotlin.RiveAnimationView.loadFileFromResource(RiveAnimationView.kt:467)
at app.rive.runtime.kotlin.RiveAnimationView.onAttachedToWindow(RiveAnimationView.kt:959)what is interesting doing the same on iOS does not have any issue:
riveViewModel.riveModel?.enableAutoBindThis is very problematic, as we cannot know when to use autobind, so we either have a crash on some of the rives, or some of them don’t work…
I think this should be fixed in the runtime, so that `setAutoBind` can be called regardless of the `riv` file content