-
Notifications
You must be signed in to change notification settings - Fork 112
Description
Sample repro: https://github.com/wardellbagby/WithCompositionRootCrash
When using withCompositionRoot in order to establish a Composable that should wrap
all composeViewFactories, along with renderings that implement AndroidViewRendering, the app
will crash when attempting to find a ViewFactory to render an AndroidViewRendering.
The root cause of this issue is how the logic to wrap ViewFactories is implemented. It relies
on ViewRegistry.getFactoryFor to return a valid view factory for every rendering class, but the
logic to return a ViewFactory for an AndroidViewRendering is based on a rendering instance,
not a rendering class. The logic that takes AndroidViewRendering's instances into account is done
by ViewRegistry.getFactoryForRendering, which is what ViewRegistry.buildView uses.