javascript - 通过谷歌登录AWS时反应本机时出错
问题描述
我通过谷歌处理AWS登录。我正在关注此链接https://github.com/patw0929/react-native-cognito-login-example但我遇到了 AWS 问题。我已经在链接中添加了 aws-sdk-react-native-core 的库但是在运行应用程序时出现错误。
java:45: error: method does not override or implement a method from a supertype
@Override
^
Note: C:\Users\krishna21\Awsslogin\node_modules\aws-sdk-react-native-core\android\src\main\java\com\amazonaws\reactnative\core\BackgroundRunner.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':aws-sdk-react-native-core:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
我已经手动添加了 aws-sdk-react-native-core。
解决方案
John, 1. 首先,您使用的库很旧,请尝试改用 AWS Amplify,它在功能上要优越得多,并且已经过安全性和错误测试。2. 在 AWS 联合登录中,可以通过两种方式完成,一种使用 Cognito 用户池以及使用 Cognito 身份池。我希望您使用的是 Cognito 身份池。3. 请在 Edit identity pool->Authentication providers->Google+ 中添加 Google Client ID 4. 将您在 Google Developer 帐户中点击的域列入白名单。
完整文档在这里https://itnext.io/google-sign-in-using-aws-amplify-and-amazon-cognito-69cc3bf219ad
推荐阅读
- php - 通过 odbc_connect() 连接到 SQL Server 数据库时出现编码问题
- asp.net-core - 安装 Microsoft.EntityFrameworkCore,版本 = 5.0.0.0 后无法搭建 DBContext
- laravel - Laravel route() - 不传递根文件夹名称
- javascript - 使用 jQuery 操作 DOM,无需更改反应代码
- android - 如何在 Kotlin 中让多个 TextView 每次都显示已编辑的 SharedPreference 的值
- python - scatter3D() 函数 ValueError:形状不匹配:无法将对象广播到单个形状
- sql - 在 sybase ASA11 中显示最近 1 小时的记录数据
- python - 来自具有不同长度的列表列表的 NumPy 数组(填充)
- node.js - 如何从nodejs中的redis slave读取数据
- java - AWS DynamoDb 使用 DynamoDbEnhancedClient 读取 BatchRead