[英]Error while adding google signin lib in react native
I'm working on login into AWS through Google, but while adding the google sign in library I'm getting an error. 我正在通过Google登录到AWS,但是在添加google登录库时出现错误。
C:\\Users\\krishna21\\Awsslogin\\node_modules\\react-native-google-signin\\android\\src\\main\\java\\co\\apptailor\\googlesignin\\RNGoogleSigninModule.java:7: error: package android.support.annotation does not exist import android.support.annotation.NonNull;
C:\\ Users \\ krishna21 \\ Awsslogin \\ node_modules \\ react-native-google-signin \\ android \\ src \\ main \\ java \\ co \\ apptailor \\ googlesignin \\ RNGoogleSigninModule.java:7:错误:程序包android.support.annotation不存在导入android.support.annotation.NonNull; ^
^
C:\\Users\\krishna21\\Awsslogin\\node_modules\\react-native-google-signin\\android\\src\\main\\java\\co\\apptailor\\googlesignin\\RNGoogleSigninModule.java:8: error: package android.support.annotation does not exist import android.support.annotation.Nullable;
C:\\ Users \\ krishna21 \\ Awsslogin \\ node_modules \\ react-native-google-signin \\ android \\ src \\ main \\ java \\ co \\ apptailor \\ googlesignin \\ RNGoogleSigninModule.java:8:错误:包android.support.annotation不存在导入android.support.annotation.Nullable; ^
^
C:\\Users\\krishna21\\Awsslogin\\node_modules\\react-native-google-signin\\android\\src\\main\\java\\co\\apptailor\\googlesignin\\Utils.java:4: error: package android.support.annotation does not exist import android.support.annotation.NonNull;
C:\\ Users \\ krishna21 \\ Awsslogin \\ node_modules \\ react-native-google-signin \\ android \\ src \\ main \\ java \\ co \\ apptailor \\ googlesignin \\ Utils.java:4:错误:包android.support.annotation不存在导入android.support.annotation.NonNull;
I have added 我已经添加了
npm install --save react-native-google-signin
this library I'm running the app through 我正在通过该库运行应用程序
react-native run-android --no-jetifier
Try adding these to your dependencies: 尝试将这些添加到您的依赖项中:
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.annotation:annotation:1.0.2'
I think you're using androidx which had a huge change in support packages: https://developer.android.com/jetpack/androidx/migrate#artifact_mappings 我认为您使用的是androidx,其支持包发生了巨大变化: https : //developer.android.com/jetpack/androidx/migrate#artifact_mappings
First of all, try using AWS Amplify, which is far superior in features and its been tested for security and errors. 首先,请尝试使用AWS Amplify,它的功能要优越得多,并且已经过安全性和错误测试。 In AWS Federated Login can be done in 2 ways, one using Cognito User Pool as well as using Cognito Identity Pool.
在AWS联合登录中,可以通过两种方式完成登录,一种使用Cognito用户池,也可以使用Cognito身份池。 Please add the Google Client ID in Edit identity pool->Authentication providers->Google+ Whitelist the domain which you are hitting in Google Developer account.
请在“编辑身份池”->“身份验证提供者”->“ Google+白名单”中添加您要在Google Developer帐户中访问的域的Google Client ID。 Full documention is here https://itnext.io/google-sign-in-using-aws-amplify-and-amazon-cognito-69cc3bf219ad
完整的文档在这里https://itnext.io/google-sign-in-using-aws-amplify-and-amazon-cognito-69cc3bf219ad
https://aws.amazon.com/blogs/mobile/amplify-framework-adds-authentication-features-and-enhancements-for-ios-and-android-mobile-sdks/ https://aws.amazon.com/blogs/mobile/amplify-framework-adds-authentication-features-and-enhancements-for-ios-and-android-mobile-sdks/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.