masked-view
masked-view copied to clipboard
Dynamic maskElement does not update on Android
Summary
I found a bug on Android where the maskElement does not update when its contents are changed. I do not see the bug on iOS.
Snack
I've replicated the bug in this Snack: https://snack.expo.dev/@bcwalk14/dynamic-mask-element.
The maskElement updates to count the seconds on iOS, but it is frozen on Android.
Versions
@react-native-masked-view/masked-view: 0.2.4
Expo: v42.0.0
(I was still able to reproduce the error with 0.2.5 and 0.2.6 of @react-native-masked-view/masked-view)
Additional Context
When I change the Expo version back to v41.0.0, I no longer see the bug where the maskElement is frozen. So, this is a regression. However, it seems like there's something in the Expo update from v41.0.0 -> v42.0.0 that's breaking the masked-view on Android rather than a breaking change that was recently committed to the masked-view codebase.
It looks like this same bug has been reported and resolved previously in issues https://github.com/react-native-masked-view/masked-view/issues/67 and https://github.com/react-native-masked-view/masked-view/issues/19.
Downgraded to 0.2.3 and it works on both Android & iOS
I think this is related. https://github.com/react-native-masked-view/masked-view/issues/22
You can try installing from master branch and running with renderingMode "software" (didn't work for me but there are people saying that it works for them).
try with https://github.com/Only-IceSoul/react-native-maskview
try with https://github.com/Only-IceSoul/react-native-maskview
Is this a new implementation?
try with https://github.com/Only-IceSoul/react-native-maskview
Is this a new implementation?
yes , Hardware Accelerated
It's impossible to animate the maskElement since the rendering mode in v0.2.4 is hardware. This would be possible if you were using v0.2.5 or v0.2.6, but this versions are incompatible with expo.
I have checked out the latest changes and I am still not able to animate stuff with mode software on android :/
Update your expo sdk to version 44. It should fix this (worked for me). The reason behind it is that in expo sdk 44 the version of this library was updated to v0.2.6. Please, close this issue if it's all ok now.
See https://github.com/expo/expo/blob/master/CHANGELOG.md#-3rd-party-library-updates-1
For me is working for android on v0.2.6 with androidRenderingMode='software' as a prop. no issue on iOS
For me is working for android on v0.2.6 with androidRenderingMode='software' as a prop. no issue on iOS
Thanks! That fixed it for me!
For me is working for android on v0.2.6 with androidRenderingMode='software' as a prop. no issue on iOS
Thanks! That fixed it for me!
Even if that does fix it, we should know why and if it works on all Android versions before jumping to usage...