masked-view icon indicating copy to clipboard operation
masked-view copied to clipboard

Dynamic maskElement does not update on Android

Open ncskier opened this issue 4 years ago • 9 comments

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.

ncskier avatar Aug 05 '21 04:08 ncskier

Downgraded to 0.2.3 and it works on both Android & iOS

ktroitsky avatar Aug 20 '21 14:08 ktroitsky

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).

hannojg avatar Sep 01 '21 06:09 hannojg

try with https://github.com/Only-IceSoul/react-native-maskview

Only-IceSoul avatar Sep 04 '21 22:09 Only-IceSoul

try with https://github.com/Only-IceSoul/react-native-maskview

Is this a new implementation?

hannojg avatar Sep 05 '21 11:09 hannojg

try with https://github.com/Only-IceSoul/react-native-maskview

Is this a new implementation?

yes , Hardware Accelerated

Only-IceSoul avatar Sep 06 '21 04:09 Only-IceSoul

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.

carlos3g avatar Sep 08 '21 15:09 carlos3g

I have checked out the latest changes and I am still not able to animate stuff with mode software on android :/

hannojg avatar Sep 27 '21 09:09 hannojg

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

carlos3g avatar Jan 26 '22 17:01 carlos3g

For me is working for android on v0.2.6 with androidRenderingMode='software' as a prop. no issue on iOS

MariusCatanoiu avatar Jul 08 '22 11:07 MariusCatanoiu

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!

ncskier avatar Jan 22 '23 02:01 ncskier

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...

Stevemoretz avatar Jan 22 '23 06:01 Stevemoretz