hello every one, when using managed work flow all goes good in my app
“expo”: “~43.0.2”,
“aws-amplify”: “^4.3.6”,
“aws-amplify-react-native”: “^6.0.1”,
“eas-cli”:“0.38.1”
but after running eas build and install the app on android and try to login, I get this message “could not find a native getrandombase64 implementation. validate that amazon-cognito-identity-js is linked” tried to google it and apparently I need to install amazon-cognito-identity-js which is impossible since I am using expo cli it only works in react-native cli any one knows what to do?
you will need to install amazon-cognito-identity-js if you are using cognito. it’s implicitly included in expo managed apps in expo go / expo build, but because eas build only includes libraries in your package.json it’s necessary to include in this context
If this is running in CI then you need to run amplify init and amplify pull on your specific environment so that amplify recreates the aws-exports file
Install and add to your dependencies the Amazon Cognito Identity SDK for JavaScript:
npm install --save amazon-cognito-identity-js
For Expo, do the above or if you use yarn then use the following instead:
yarn add amazon-cognito-identity-js
Install react-native-cli if you have not already:
npm install -g react-native-cli
The above is not necessary with Expo.
Link the native modules to your project:
react-native link amazon-cognito-identity-js
The above is not necessary with Expo.
EDIT:
As notbrent says, amazon-cognito-identity-js is included in Expo Go and in apps built with expo build, so this should work OK in Expo Go. Usually when you install dependencies like this which have native code and build with EAS Build, the app will not work in Expo Go or when built with expo build.
So for other similar libraries, instead of using Expo Go you would need to build a custom dev client and install that on your phone/emulator/simulator.