react-native-camera / react-native-camera

A Camera component for React Native. Also supports barcode scanning!

Home Page:https://react-native-camera.github.io/react-native-camera/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

android:Attempt to invoke virtual method 'double java.lang.Double.doubleValue()' on a null object reference

daltachange opened this issue · comments

commented

3961662618770_ pic

version:4.2.1

code:

useEffect(() => {
const focusScreenListener = props.navigation.addListener('focus', () => {
if (cameraRef.current) {
cameraRef.current.resumePreview(); // error
}
});
return () => {
props.navigation.removeListener('focus', focusScreenListener);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

Yes, same problem here. Everything is fine until I call pausePreview or resumePreview in an useEffect callback.

Any updates on this?