question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Screen Flashes When App Opens Camera and return back to screen

See original GitHub issue

I am using react-native-image-crop-picker to open camera and capture picture

Version

  • react-native-image-crop-picker v0.37.2
  • react-native v0.66.4
  • react-native-screens -v3.10.1

Platform

  • iOS

Expected behaviour

After capturing the image using

Screen should not flicker as shown in attached video

Actual behaviour

Screen flickers once after closing the camera

Steps to reproduce

1.ImageCropPicker.openCamera({ width: 300, height: 400, cropping: true, includeBase64: true, });

  1. capture image and click use photo once camera closed and it returns back to app screen, screen flickers

Attachments

https://user-images.githubusercontent.com/42070594/150831876-bec865a6-c981-4f0d-b7a3-713eb3ac922b.mp4

###Code For Camera Permission I am using react-native-vision-camera

const onTakePicture = useCallback(async () => {
    if (onPressPrimaryBtn) {
      onPressPrimaryBtn();
    } else {
      const camPermission = await Camera.getCameraPermissionStatus();
      console.log(camPermission)
      if (camPermission === CAMERA_PERMISSIONS.AUTHORIZED || camPermission === CAMERA_PERMISSIONS.NOT_DETERMINED) {
        const image = await Camera.capturePhoto();
        image &&
          toScreen &&
          navigation?.navigate(toScreen, {imagePath: image?.path});
      } else if (camPermission === CAMERA_PERMISSIONS.DENIED) {
        //To Do Custom Modal
        return Alert.alert('Camera', 'Camera Permission Has To Be Enabled', [
          {
            text: 'Open Settings',
            onPress: openSettings,
          },
        ]);
      }
    }
  }, []);

#Camera.capturePhoto

static capturePhoto = async () => {
   return await ImageCropPicker.openCamera({
     width: 300,
     height: 400,
     cropping: true,
     includeBase64: true,
   });
 };

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
MaganAnkurcommented, Jan 25, 2022

no worries @jforaker I got this, i used patch-package to use the patch and its working as expected. closing this issue as this is not a react-native-screens issue .

Thanks @jforaker for all your help

0reactions
jforakercommented, Jan 24, 2022

Thanks @jforaker for your quick response, I tried the patch and yes its working. I know its react-native-image-crop-picker issue. but just asking if I put that fix by changing the file it will rewrite my changes on fresh pod install isn’t it? could you pls suggest how can I use the patch version. sorry for my naive question. Your help is appreciated

@MaganAnkur - I’m not sure, I don’t have experience with that actually – I was just crossposting because I’ve seen the issue before. Best of luck.

Read more comments on GitHub >

github_iconTop Results From Across the Web

why are my apps flashing then going back to the home screen ...
Try as "Back" said hard reset it. ... I got the solution just go in settings then apps then open the three dot...
Read more >
“Flashing” Screen as if a photo is being … - Apple Community
To check open System Preferences and select the Universal Access pane. Then select the Hearing tab, the first tick box has the option...
Read more >
Is Your Phone Display Flickering? Try These 7 Fixes
The first thing to do when trying to fix a glitching phone screen is to restart your phone to ensure that this isn't...
Read more >
How to Fix Screen Flickering on Android - Lifewire
Stop your Android screen from flickering or acting glitchy. Try these steps to diagnose, troubleshoot, and repair a flickering display.
Read more >
Phone Screen Display Glitching, Flickering & Flashing - Updato
One of the main reasons that older devices can have the screen flickering issue is due to a sort of software struggle. Under...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found