-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Describe the bug
Well, i dont know if its a bug, but currently i have a problema with a release build for android. In debug i have no problem, the package seems to functions perfectly, but in release mode it doesnt. And i dont know why.
Maybe im missing something, ig someone knows what it is please tell me.
Maybe its because in my androidmanifest im using this: android:screenOrientation="portrait". But i would like to know if thats the problem to change my approach
To Reproduce
Steps to reproduce the behavior:
When the phone turn to Landscape right or left, it should change the content inside the modal.
Expected behavior
Do the same that already does in debug, but in release.
Screenshots
If applicable, add screenshots to help explain your problem.
As i said, this is from the debug build, but in release doesnt work (the content from the modal dont turn to horizontal)
Vertical

Smartphone (please complete the following information):
- OS: MyOS11.0.18_A2022L_TEL (Android 11)
- Device: ZTE Axon 30 2022L
Environment
System:
OS: Windows 11 10.0.22631
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
Memory: 1.99 GB / 7.80 GB
Binaries:
Node:
version: 24.11.1
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.19
path: C:\Users\engin\AppData\Roaming\npm\yarn.CMD
npm:
version: 11.6.2
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: AI-252.25557.131.2521.14432022
Visual Studio:
- 16.11.32126.315 (Visual Studio Community 2019)
Languages:
Java:
version: 21.0.9
path: C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 20.0.0
wanted: 20.0.0
react:
installed: 19.1.1
wanted: 19.1.1
react-native:
installed: 0.82.1
wanted: 0.82.1
react-native-windows: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Additional context
The code:
App.tsx
`import { StatusBar, StyleSheet, Text, useColorScheme, View } from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { CameraView } from './src/components/CameraView';
import { Modal } from './src/components/Modal';
import { useState } from 'react';
import { useDeviceOrientation, Orientation, useInterfaceOrientation } from 'react-native-orientation-director';
function App() {
const isDarkMode = useColorScheme() === 'dark';
const [isModalVisible, setIsModalVisible] = useState(false);
const [info, setInfo] = useState('');
const deviceOrientation = useDeviceOrientation();
const isLandscapeLeft = deviceOrientation == Orientation.landscapeLeft || deviceOrientation == Orientation.faceDown;
const isLandscapeRight = deviceOrientation == Orientation.landscapeRight || deviceOrientation == Orientation.faceDown;
const modalOrientation: 'left' | 'right' | undefined = isLandscapeLeft ? 'left' : isLandscapeRight ? 'right' : undefined;
return (
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
<CameraView
style={styles.cam}
onCodeDetected={event => {
const { hasCode, data } = event.nativeEvent;
console.log('Evento recibido:', hasCode, data);
if (hasCode) {
if (data.includes('_')) {
console.log('split4', data.split('_')[4]);
setInfo(`Placa ${data.split('_')[4]}`); //Para mandar solo la placa
} else {
console.log('DATA', data);
setInfo('Placa falsificada');
}
setIsModalVisible(true);
}
}}
/>
</SafeAreaProvider>
);
}
const styles = StyleSheet.create({
cam: { flex: 1, transform: [{ scale: 1.15 }] },
});
export default App;
The CameraView.tsx:import { requireNativeComponent, ViewStyle } from 'react-native';
import React from 'react';
interface Props {
style?: ViewStyle;
onCodeDetected?: (event: { nativeEvent: { hasCode: boolean; data: string } }) => void;
}
const NativeCameraView = requireNativeComponent('CameraXView');
export const CameraView = (props: Props) => {
return <NativeCameraView {...props} />;
};`
And the Modal.tsx:
`import React, { useEffect, useRef } from 'react';
import { TouchableWithoutFeedback, View, Text, StyleSheet } from 'react-native';
import LottieView from 'lottie-react-native';
interface ModalProps {
isModalVisible: boolean;
setIsModalVisible: React.Dispatch<React.SetStateAction>;
info?: string;
setInfo?: React.Dispatch<React.SetStateAction>;
isLandscape?: 'right' | 'left' | null;
}
export const Modal: React.FC = ({ setIsModalVisible, isModalVisible, info, isLandscape }) => {
// console.log('isLandscape en Modal:', isLandscape);
const animationRef = useRef(null);
useEffect(() => {
// animationRef.current?.play();
// Or set a specific startFrame and endFrame with:
animationRef.current?.play(0, 50);
}, [isModalVisible]);
return (
isModalVisible && (
<TouchableWithoutFeedback onPress={() => setIsModalVisible(false)}>
<View
style={[
styles.modalView,
{
width: isLandscape === 'right' || isLandscape === 'left' ? '100%' : '80%',
height: isLandscape === 'right' || isLandscape === 'left' ? '40%' : '50%',
transform: isLandscape === 'right' ? [{ rotate: '270deg' }] : isLandscape === 'left' ? [{ rotate: '90deg' }] : [{ rotate: '0deg' }],
},
]}>
<LottieView
ref={animationRef}
source={info == 'Placa falsificada' ? require('../../assets/Warning.json') : require('../../assets/Check.json')}
style={{
marginTop: -50,
backgroundColor: 'transparent',
width: isLandscape === 'right' || isLandscape === 'left' ? '100%' : '100%',
height: isLandscape === 'right' || isLandscape === 'left' ? '90%' : '100%',
}}
loop={false}
/>
<Text style={[styles.text, { marginBottom: isLandscape === 'right' || isLandscape === 'left' ? 15 : 30 }]}>{info}
)
);
};
const styles = StyleSheet.create({
modalContainer: {
position: 'absolute',
zIndex: 10,
top: 0,
left: 0,
right: 0,
bottom: 0,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgba(0,0,0,0.5)',
},
modalView: { backgroundColor: 'white', borderRadius: 10, justifyContent: 'center', alignItems: 'center' },
text: { fontSize: 16, fontWeight: 'bold', textAlign: 'center', position: 'absolute', bottom: 0 },
});
`
