简体   繁体   English

在React Native中添加Google登录库时出错

[英]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.

相关问题 反应原生 | 应用程序因“react-native-google-signin”而崩溃 - React Native | App Crash because of “react-native-google-signin” Google SignIn SDK 因抛出错误而失败,出现不可恢复的登录失败 - 捕获错误:React Native - Google SignIn SDK is failing by throwing error, A non-recoverable sign in failure occurred -catch error: React Native 添加反应原生元素以反应原生时出错 - Error while adding react native elements to react native 反应原生谷歌登录返回状态代码:12501 - react native google signin return status code: 12501 react-native-google-signin-无法读取未定义的属性'number' - React-native-google-signin - Cannot read property 'number' of undefined 添加反应原生矢量图标以使用反应原生 web 反应原生时出错 - Error while adding react native vector icons to react native with react native web 通过Google在React Native中登录到AWS时出错 - Error while login into AWS through google in react native AWS通过google登录React Native时出错 - Error while AWS login through google in react native 无法解析模块。/SignIn In React Native 应用程序 - Unable to resolve module ./SignIn In React Native app @react-native-google-signin/google-signin/src/GoogleSignin.js 抛出异常 null 不是 object(评估 'RNGoogleSignin.SIGN_IN_CANCELLED') - @react-native-google-signin/google-signin/src/GoogleSignin.js threw an exception null is not an object (evaluating 'RNGoogleSignin.SIGN_IN_CANCELLED')
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM