aws-amplify login fails after eas build

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

edit: i updated the mirgation docs to clarify this - [docs] Add note about amazon-cognito-identity-js · expo/expo@7e5b456 · GitHub

1 Like

Where did you see this? EAS Build allows you to install many things that you would not have been able to use in a Managed Expo app previously.


sorry, amazon-cognito-identity-js was installed but here is what i get when i try eas buil android, any help?

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

the file is there in my source codes but I don’t know why it showing me that error coz locally it’s even working

As far as I know eas uses your .gitignore to ignore files(in this case aws-exports.js), you can override it by using a .easignore file

Mine looks as follows:

node_modules
.expo
.keys

#amplify-do-not-edit-begin
amplify/\#current-cloud-backend
amplify/.config/local-*
amplify/logs
amplify/mock-data
amplify/backend/amplify-meta.json
amplify/backend/awscloudformation
amplify/backend/.temp
build/
dist/
node_modules/
awsconfiguration.json
amplifyconfiguration.json
amplifyconfiguration.dart
amplify-build-config.json
amplify-gradle-config.json
amplifytools.xcconfig
.secret-*
**.sample
#amplify-do-not-edit-end