gre / react-native-view-shot

Snapshot a React Native view and save it to an image

Home Page:https://github.com/gre/react-native-view-shot-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-view-shot error: failed to capture view snapshot on android with MaskedView from '@react-native-community/masked-view'

DmitryB11 opened this issue · comments

I use react-native-view-shot and it works with no problem on iOS but on Android I got
error: failed to capture view snapshot
I put collapsable={false} but it is not works. It only works if I remove MaskedView, but I can't do it because I need it in my code.
My code about the same as in this post.
MaskedView from '@react-native-community/masked-view'

  <MaskedView maskElement={
    <Text style={[styles.label, styleLabelAlign, styleLabelSize, styleLabelWeight, props.styleText]}>
      {labels?.join('\n')}
    </Text>
  }>
    <LinearGradient start={{ x: 0, y: 1 }} end={{ x: 1, y: 0 }} colors={[props.primaryColor, props.secondaryColor]}>
      <Text style={[styles.label, styleLabelAlign, styleLabelSize, styleLabelWeight, props.styleText, { opacity: 0 }]}>{labels?.join('\n')}</Text>
    </LinearGradient>
  </MaskedView>

`

Originally posted by @prani95 in #489 (comment)