如何使用 adb 在 React Native Expo 应用程序中设置 Google 登录?有新的更新

问题描述 投票:0回答:1

当我添加这行代码时:

GoogleSignin.configure({
  webClientId: '',
  offlineAccess: true,
});",

它会给我这个错误:

Error: RN GoogleSignin native module is not correctly linked. Please read the readme, setup and troubleshooting instructions carefully.
If you are using Expo, make sure you are using Custom dev client, not Expo go., js engine: hermes",i m also using expo-dev-client , after module's correct linking it will give me same error, i m using android adb,how to resolve this error , please provide me solution quickly. this is my package.json "{
  "name": "second_project",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "11": "^0.0.1",
    "@expo/vector-icons": "^13.0.0",
    "@expo/webpack-config": "^19.0.0",
    "@react-native-async-storage/async-storage": "1.18.2",
    "@react-native-community/datetimepicker": "7.2.0",
    "@react-native-community/google-signin": "^5.0.0",
    "@react-native-firebase/app": "^18.7.3",
    "@react-native-firebase/auth": "^18.7.3",
    "@react-native-google-signin/google-signin": "^11.0.0",
    "@react-native-picker/picker": "2.4.10",
    "@react-navigation/bottom-tabs": "^6.5.11",
    "@react-navigation/material-top-tabs": "^6.6.5",
    "@react-navigation/native": "^6.1.9",
    "@react-navigation/stack": "^6.3.20",
    "@reduxjs/toolkit": "^1.9.7",
    "@types/react-redux": "^7.1.31",
    "expo": "~49.0.13",
    "expo-auth-session": "~5.0.2",
    "expo-build-properties": "~0.8.3",
    "expo-camera": "~13.4.4",
    "expo-crypto": "~12.4.1",
    "expo-doctor": "^1.1.3",
    "expo-file-system": "~15.4.5",
    "expo-google-sign-in": "^11.0.0",
    "expo-image-picker": "~14.3.2",
    "expo-permissions": "^14.2.1",
    "expo-splash-screen": "~0.20.5",
    "expo-status-bar": "~1.6.0",
    "firebase": "^10.7.1",
    "link": "^2.1.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "^0.72.6",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-gifted-chat": "^2.4.0",
    "react-native-google-signin": "^2.1.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-link": "^4.1.0",
    "react-native-pager-view": "6.2.0",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-swiper": "^1.6.0",
    "react-native-tab-view": "^3.5.2",
    "react-native-uuid": "^2.0.1",
    "react-native-vector-icons": "^10.0.2",
    "react-native-web": "~0.19.6",
    "react-redux": "^8.1.3",
    "redux": "^4.2.1",
    "redux-saga": "^1.2.3",
    "typescript": "^5.1.3",
    "yet": "^0.1.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/react-native": "^0.72.8"
  },
  "private": true
}

我已经尝试了 GitHub 项目中提到的所有内容,但错误仍然相同,我已经尝试过

npx expo install react-native-google-signin/google-signin
进行博览会,但没有执行任何操作。仍然有错误请帮我解决这个错误。

react-native expo google-signin
1个回答
0
投票

您正在混合使用 React-Native-Firebase (RNF)、Firebase Web Client SDKReact-Native Google Sign In

这是三个非常不同的库/API 集,这是您肯定不想做的事情。

我写了这篇文章,其中涵盖了 RNF 和 Firebase Web 客户端库之间的差异以及推荐的方法。

如果您尝试使用 Firebase 身份验证及其 Google 登录提供商,那么您不想使用

react-native-google-sign-in
。如果您不使用 Firebase,那么您不应该使用 RNF 或 Firebase Web 客户端。

选择一种方法,选择一个库,并删除其他库。然后,按照该 one API 的 API 文档,使用您决定正确使用的 one API。

© www.soinside.com 2019 - 2024. All rights reserved.