'React navigation: navigate causes app to crash on expo client

I have the below navigation stack. I am trying to navigate from login to signup. Things seem to work completely fine on the android emulator. But when i try to navigate on an android phone on expo client the app crashes. There are no errors and it doesnt even hit debugger even though pause on exception is on.

Following is the definition of the stack:

import React from 'react';
import { createStackNavigator } from '@react-navigation/stack';
import LoginScreen from './LoginScreen';
import SignUpPhone from './SignUpPhone';
import { PostJobInfo, RoutePaths } from '../../shared/models/model';


const Stack = createStackNavigator();

const AuthStack = (): JSX.Element => (
  <Stack.Navigator initialRouteName={RoutePaths.login}>
    <Stack.Screen name={RoutePaths.login} component={LoginScreen} />
    <Stack.Screen
      name={RoutePaths.signUp}
      component={SignUpPhone}
      options={{
        title: 'Sign Up',
      }}
    />
  </Stack.Navigator>
);

export default AuthStack;

Its weird i thought it was a problem with the target screen so i erased all of the code inside of signup and just left a simple <Text> but then the app still crashed. I even set the initialRouteName to sign-up and it works. I then tried navigating to login from the sign up component and it crashed again. Ive reinstalled all the packages but its to no avail. Thing is it reaches the target screen, ive added console.logs in the target screen and that was printed out. Im completely dumbstruck and have been on this issue for the past few weeks, any help is appreciated.

Packages:

 "@react-navigation/native": "6.0.6",
 "@react-navigation/native-stack": "^6.2.5",
 "@react-navigation/stack": "^5.14.5",
 "expo": "~41.0.1",
 "react-native-safe-area-context": "3.2.0",
 "react-native-screens": "~3.0.0",

since the question's turning out to be a bit long ive included the code for login and signup on this stack blitz,(note ive just added it for the code the project is not runnable)



Solution 1:[1]

Ok so i have no idea why but it was the attemptInvisibleVerification option which caused the crash. After I turned it off the navigation works smoothly. The feature is experimental from the expo-firebase-recaptcha package so it makes sense. If anyone could explain why it did what it did would be extremely grateful

Solution 2:[2]

all you need to do is,

animationEnabled: Platform.OS == 'android' && parseInt(deviceInfoModule.getSystemVersion()) > 9 ? false : true,

that's how I resolved this issue

PS. you have to embed this code-snippet in the stack navigator's options property

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 KZoeps
Solution 2