'React Native aws-amplify Auth.signIn throwing NotAuthorizedException on android only when used with react native reanimated

I'm using aws-amplify: 4.3.11, aws-amplify-react-native: 6.0.4.

When I try to sign in and enter username and password, it first freezes the screen and hangs the sign-in button, then works and throws an exception  

"Incorrect username or password". Error NotAuthorizedException.

It was operating OK for me until it began to cause problems, such as logging in the user sometimes and not logging in the user at other times, and eventually, it stopped working entirely.

Furthermore, it is fully functional on iOS. Also, when I open the settings or debug the application from the developer menu, the application crashed.

However, It starts working when I uninstall react-native-reanimated and react-navigation/drawer and clean the project. However, anytime I reinstall them and my default screen is the drawer, it causes the app to crash just by accessing it.

However, if I make the signUp screen the initial route, the application runs but in Auth.SignIn I'm still getting the NotAuthorizedException issue when I try to sign in.

Here is my code of sign In

     let responseSignIn = await Auth.signIn({
       username: email.toLowerCase(),
       password,
     });
     if (responseSignIn) {
       let session = await Auth.currentSession();
       let token = session.getIdToken().getJwtToken();
       saveToken(token);
       setLoading(false);
       dispatch(LoginWithEmailSuccess({token}));
       console.log(token);
     }
   } catch (e) {
     console.log(`Error ${e}`);
     setpasswordError(e.message);
     setLoading(false);
   }```

Here is my package.json file 


```{
 "name": "SkillGigs",
 "version": "0.0.1",
 "private": true,
 "scripts": {
   "android": "react-native run-android",
   "ios": "react-native run-ios",
   "start": "react-native start",
   "test": "jest",
   "lint": "eslint ."
 },
 "dependencies": {
   "@apollo/client": "^3.5.7",
   "@brlja/react-native-slider": "^0.12.1",
   "@react-native-async-storage/async-storage": "^1.15.14",
   "@react-native-community/checkbox": "^0.5.9",
   "@react-native-community/clipboard": "^1.5.1",
   "@react-native-community/netinfo": "^7.1.7",
   "@react-native-google-signin/google-signin": "^7.0.4",
   "@react-native-picker/picker": "^2.2.1",
   "@react-navigation/material-top-tabs": "^6.1.1",
   "@react-navigation/native": "^6.0.6",
   "@react-navigation/stack": "^6.0.11",
   "amazon-cognito-identity-js": "^5.2.3",
   "aws-amplify": "^4.3.11",
   "aws-amplify-react-native": "^6.0.4",
   "axios": "^0.21.1",
   "date-fns": "^2.28.0",
   "graphql": "^14.0.0",
   "moment": "^2.29.1",
   "react": "17.0.2",
   "react-native": "^0.66.4",
   "react-native-autocomplete-input": "^5.0.2",
   "react-native-calendar-picker": "^7.1.2",
   "react-native-calendars": "^1.1277.0",
   "react-native-chart-kit": "^6.12.0",
   "react-native-cn-quill": "^0.7.15",
   "react-native-color-matrix-image-filters": "^5.2.10",
   "react-native-dimension": "^1.0.6",
   "react-native-document-picker": "^7.1.3",
   "react-native-draggable-flatlist": "^3.0.6",
   "react-native-dropdown-picker": "^5.2.3",
   "@react-navigation/drawer": "^6.1.4",
   "react-native-fbsdk": "^3.0.0",
   "react-native-geolocation-service": "^5.3.0-beta.4",
   "react-native-gesture-handler": "^2.1.1",
   "react-native-get-random-values": "^1.7.2",
   "react-native-image-crop-tools": "^1.5.0",
   "react-native-image-picker": "^4.7.0",
   "react-native-image-resizer": "^1.4.5",
   "react-native-image-rotate": "^2.1.0",
   "react-native-image-to-pdf": "^1.2.0",
   "react-native-modal-dropdown": "^1.0.2",
   "react-native-pager-view": "^5.4.11",
   "react-native-ratings": "^8.1.0",
   "react-native-reanimated": "^2.4.1",
   "react-native-render-html": "^6.3.4",
   "react-native-responsive-screen": "^1.4.2",
   "react-native-safe-area-context": "^3.3.2",
   "react-native-screens": "^3.10.1",
   "react-native-share": "^7.3.7",
   "react-native-simple-image-cropper": "^3.2.1",
   "react-native-simple-radio-button": "^2.7.4",
   "react-native-svg": "^12.1.1",
   "react-native-swiper": "^1.6.0",
   "react-native-switch-toggle": "^2.2.1",
   "react-native-tab-view": "^3.1.1",
   "react-native-vector-icons": "^9.0.0",
   "react-native-video": "^5.1.1",
   "react-native-virtualized-view": "^0.1.5",
   "react-native-webview": "^11.16.0",
   "react-redux": "^7.2.6",
   "redux": "^4.1.2",
   "redux-saga": "^1.1.3",
   "rn-fetch-blob": "^0.12.0",
   "victory-native": "^36.3.1"
 },
 "devDependencies": {
   "@babel/core": "^7.16.5",
   "@babel/runtime": "^7.16.5",
   "@react-native-community/eslint-config": "^3.0.1",
   "babel-jest": "^27.4.5",
   "eslint": "^8.5.0",
   "jest": "^27.4.5",
   "metro-react-native-babel-preset": "^0.66.2",
   "react-test-renderer": "17.0.2"
 },
 "jest": {
   "preset": "react-native"
 }
}```


Sources

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

Source: Stack Overflow

Solution Source