Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Failed to capture view snapshot on React Native 0.72.0 #482

Open
n-ii-ma opened this issue Jun 24, 2023 · 12 comments
Open

Error: Failed to capture view snapshot on React Native 0.72.0 #482

n-ii-ma opened this issue Jun 24, 2023 · 12 comments

Comments

@n-ii-ma
Copy link

n-ii-ma commented Jun 24, 2023

bug report

After upgrading to React Native 0.72.0, I get the Failed to capture view snapshot error.

It worked on React Native 0.71.11

Version & Platform

[email protected] /Users/vedadi/Aria
├─┬ @gorhom/[email protected]
│ ├─┬ @gorhom/[email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ @notifee/[email protected]
│ └── [email protected] deduped
├─┬ @react-native-async-storage/[email protected]
│ └── [email protected] deduped
├─┬ @react-native-clipboard/[email protected]
│ └── [email protected] deduped
├─┬ @react-native-community/[email protected]
│ └── [email protected] deduped
├─┬ @react-native-firebase/[email protected]
│ └── [email protected] deduped
├─┬ @react-native-masked-view/[email protected]
│ └── [email protected] deduped
├─┬ @react-navigation/[email protected]
│ └── [email protected] deduped
├─┬ @react-navigation/[email protected]
│ ├─┬ @react-navigation/[email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ @sentry/[email protected]
│ └── [email protected] deduped
├─┬ [email protected] (git+ssh://[email protected]/aria-khodro/react-native-background-timer.git#18cc30364d35492e2e5d6390f0b61fb9544d022f)
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected] (git+ssh://[email protected]/aria-khodro/react-native-modern-datepicker.git#1262b655a4585300bdb71043ebe0e11ffa391ecc)
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected] (git+ssh://[email protected]/aria-khodro/react-native-qrcode-svg.git#fbef3350002dc9a921fee1fc281886abdd5a908b)
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └─┬ @react-native/[email protected]
│   └── [email protected] deduped
└─┬ [email protected]
  └── [email protected] deduped

Platform: Only happens on Android

@arasrezaei
Copy link

arasrezaei commented Jul 14, 2023

expriencing same issue, no error occured and no uri has produced,
expo sdk 49
react native 72.3 with new arch

@n-ii-ma
Copy link
Author

n-ii-ma commented Jul 15, 2023

expriencing same issue, no error occured and no uri has produced, expo sdk 49 react native 72.3 with new arch

Finally someone else reports this issue!
I don't think this package is actively maintained anymore.

Would appreciate if anyone recommends an alternate package that works with new versions of RN.

@Shankulkarni
Copy link

Any update on this?
I am facing the same issue on Android.

@timothyerwin
Copy link

I'm facing the same issue in android

 ERROR  Oops, snapshot failed [Error: Failed to capture view snapshot]

@n-ii-ma
Copy link
Author

n-ii-ma commented Jul 24, 2023

Until this package is updated in order to become compatible with RN v0.72+, it should be considered obsolete.

@paulsonnenschein
Copy link

I had this problem, but this seems to have fixed it for me: #7 (comment)

@n-ii-ma
Copy link
Author

n-ii-ma commented Jul 30, 2023

Adding collapsable={false} to the View component which you want to capture temporarily fixes this issue.

Thanks to @paulsonnenschein (#482 (comment)) for pointing to the solution: #7 (comment)

@Akshaybagai52
Copy link

Can anyone tell me if they able to get the solution for this issue it is urgent for me to do that if there are any library which can replace this library then you can tell me

@n-ii-ma
Copy link
Author

n-ii-ma commented Sep 3, 2023

Can anyone tell me if they able to get the solution for this issue it is urgent for me to do that if there are any library which can replace this library then you can tell me

Did you try adding collapsable={false} to the View component which you want to capture?

@nijarv
Copy link

nijarv commented Oct 16, 2023

I'm using ImageBackground from react-native and continue to encounter the error on Android, even after setting collapsible to false. However, it works perfectly on iOS.

<ImageBackground
    ref={viewRef}
    collapsable={false}
    source={{ uri: themeUriPath }}
    style={{ height: '100%', width: '100%' }}
>
    {renderLayers()}
</ImageBackground>

@dominik-mrugalski
Copy link

Adding collapsable={false} to the View component which you want to capture temporarily fixes this issue.

Thanks to @paulsonnenschein (#482 (comment)) for pointing to the solution: #7 (comment)

I've checked this solution and it won't work for me (iOS was OK but android had an error). I had to change View to the ViewShot tag, and it started working.

@fabiiomariiano
Copy link

To me, unbelievable, what worked was removing a negative margin left from Video component.

import { Video } from 'expo-av'
 ....
return (
  <Video
    source={{ uri: props.url }}
    style={{
      position: 'absolute',
      top: 0,
      left: 0,
      width: '100%',
      height: '100%',
      marginLeft: '-10%',
    }}
  />
);

This way, always that the video is on screen, the error [Error: Failed to capture view snapshot] occurs.

After remove the marginLeft, came back to works fine o.O

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants