簡體   English   中英

@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')

我正在為 firebase 項目使用 firebase 實現 GoogleSign。 我安裝了這三個包:

    "@react-native-firebase/app": "^11.3.0",
    "@react-native-firebase/auth": "^11.3.0",
    "@react-native-google-signin/google-signin": "^6.0.0",

然后在我的 Login.js 文件中,我將它們導入為:

import auth from '@react-native-firebase/auth'
import { GoogleSignin } from '@react-native-google-signin/google-signin';

然后在function Login(props) {我已經

    GoogleSignin.configure({
        webClientId: 'MY_WEB_CLIENT_ID.apps.googleusercontent.com'
    });

但是,一旦我運行,我就會收到此錯誤:

錯誤:需要模塊“node_modules/@react-native-google-signin/google-signin/src/GoogleSignin.js”,引發異常:TypeError: null is not an object (evaluating 'RNGoogleSignin.SIGN_IN_CANCELLED')

請運行 pod-install 並在 pod install 上確認

Installing FirebaseAuth (8.1.0)
Installing FirebaseInstallations (8.1.0)
Installing FirebaseMessaging (8.1.0)
Installing GTMAppAuth (1.2.2)
Installing GTMSessionFetcher (1.5.0)
Installing GoogleSignIn (5.0.2)
Installing GoogleUtilities 7.4.1
Installing RNFBAuth (12.1.0)
Installing RNFBMessaging (12.1.0)
Installing **RNGoogleSignin** (6.0.0)

我正在使用“8.0.0”版本降級到“7.2.2”對我來說是個騙局。 請記住刪除^反對這樣的版本號:

@react-native-google-signin/google-signin": "7.2.2"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM