Closed chiefchief closed 3 months ago
I have the same issue https://shopify.github.io/react-native-skia/docs/canvas/overview just copy and paste crash on android
I believe you need a collapsable={false}
on your viewRef to solve this on android for views outside viewport.
See https://shopify.github.io/react-native-skia/docs/snapshotviews/
return (
<>
<View ref={viewRef} style={{ position: 'absolute', left: screenWidth }} collapsable={false}>
<View style={{ flexDirection: 'row' }}>
<View style={{ flex: 1 }}>
<Text>{`Name: ${data.name}`}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text>{`Second Name: ${data.secondName}`}</Text>
</View>
</View>
{imageSrc && <Image source={{ uri: imageSrc }} style={{ width, height }} onLoad={onLoad} />}
</View>
<Canvas ref={canvasRef} style={{ height, width, backgroundColor: 'white' }} onTouch={onTouch}>
<Path path={activePath} style={'stroke'} strokeWidth={2} />
</Canvas>
</>
);
I believe you need a
collapsable={false}
on your viewRef to solve this on android for views outside viewport. See https://shopify.github.io/react-native-skia/docs/snapshotviews/return ( <> <View ref={viewRef} style={{ position: 'absolute', left: screenWidth }} collapsable={false}> <View style={{ flexDirection: 'row' }}> <View style={{ flex: 1 }}> <Text>{`Name: ${data.name}`}</Text> </View> <View style={{ flex: 1, alignItems: 'flex-end' }}> <Text>{`Second Name: ${data.secondName}`}</Text> </View> </View> {imageSrc && <Image source={{ uri: imageSrc }} style={{ width, height }} onLoad={onLoad} />} </View> <Canvas ref={canvasRef} style={{ height, width, backgroundColor: 'white' }} onTouch={onTouch}> <Path path={activePath} style={'stroke'} strokeWidth={2} /> </Canvas> </> );
i tried but didn't help, also tried - removeClippedSubviews: false, the same result
this should be fixed now, if it's still happening let us know and we will add it to the test suite.
Description
I'm implementing a signature pad feature where users can update their signature. Upon updating, I need to capture the user's first and last name and take a screenshot. However, my view is located outside the viewport. I'm using Expo for development. Interestingly, everything works fine when the app is in debug mode. However, upon building the internal distribution version, the app crashes.
Below is the crash report from Sentry.
Version
^0.1.240
Steps to reproduce
described above
Snack, code example, screenshot, or link to a repository