gre / react-native-view-shot

Snapshot a React Native view and save it to an image
https://github.com/gre/react-native-view-shot-example
MIT License
2.64k stars 344 forks source link

Crash error on android #507

Open pierroo opened 7 months ago

pierroo commented 7 months ago

bug report

I get this error when I try to "viewShotRefs?.current.capture().then..." image

obviously there may be something wrong in my view that I have yet to find, but why does it crash? it should simply go into the }).catch(e => { etc

Version & Platform

v3.7.0 RN 0.69.12

Platform: Android

Expected behavior

Actual behavior

Steps to reproduce the behavior

songxiaoliang commented 5 months ago

Same question

songxiaoliang commented 5 months ago

@pierroo solve it?

pierroo commented 5 months ago

@songxiaoliang yup, not a sexy fix but I simply wrapped the capture in a 300ms timeout and it fixed it. no clue why, let me know if it worked for you too?

songxiaoliang commented 5 months ago

@pierroo oh, no

songxiaoliang commented 5 months ago

@pierroo I've been practicing the implementation you've given me, and I haven't found any problems so far, thanks!