AWS Cognito:在 Auth.signIn 中出现错误(验证 amazon-cognito-identity-js 已链接)

AWS Cognito: Getting error in Auth.signIn (Validate that amazon-cognito-identity-js has been linked)

我不熟悉 Amplify 与 Cognito 的集成,并且正在使用 Amplify 和 Cognito 进行身份验证来开发反应本机应用程序。我已经在 AWS 控制台中配置了用户池和联合身份。

我已经使用 react-navigation 5.x 版本创建了自己的注册和登录界面。 下面是我在package.json

中添加的AWS相关模块
"@aws-amplify/auth": "^3.4.24",
"@aws-amplify/core": "^3.8.16",

这是 App.js

中的 Amplify 配置
 Amplify.configure({ 
  Auth: { 
    identityPoolId: 'eu-west-2:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
    region: 'eu-west-2',
    userPoolId: 'eu-west-2_xxxxxxxx',
    userPoolWebClientId: 'xxxxxxxxxxxxxxxxxxxxxx',
    authenticationFlowType: 'USER_PASSWORD_AUTH'
  }
});

我能够成功调用 Auth.signUp 但是当我尝试调用 Auth.signIn(用户名,密码)

Validate that amazon-cognito-identity-js has been linked

如何才能成功调用Auth.signIn,请帮忙解决问题?

我遇到了同样的问题,我通过安装 Cognito Identity 解决了这个问题。 运行 以下:

npm i amazon-cognito-identity-js

安装后再次启动 rn

npm start