react-native-google-signin / google-signin

Google Sign-in for your React Native applications
https://react-native-google-signin.github.io/
MIT License
3.12k stars 877 forks source link

Tried to register two views with the same name RNGoogleSigninButton error #1253

Closed Str1ien closed 3 months ago

Str1ien commented 4 months ago

I encountered this issue just after installing the public package from npm with npm i @react-native-google-signin/google-signin. I simply did the imports in my code, declared a GoogleSignInButton component and gave it some props.

Expected Behavior

Button is shown and stays on the screen when the code is changed.

Actual Behavior

The first time the component is declared the button stays and is usable. After I do 1 change on the component code, it dissapears. If I delete the component from the code, save so it refreshes, and add it back again, I get the following error:

Screenshot from 2024-03-05 13-40-03

If I run npm dedupe, the button shows up again but as soon as I touch the code the error shows up again.

Environment

This my package.json file:

{
  "name": "PlayBeat",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest"
  },
  "dependencies": {
    "@react-native-google-signin/google-signin": "^11.0.0",
    "react": "18.2.0",
    "react-native": "0.73.5"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native/babel-preset": "0.73.21",
    "@react-native/eslint-config": "0.73.2",
    "@react-native/metro-config": "0.73.5",
    "@react-native/typescript-config": "0.73.1",
    "@types/react": "^18.2.6",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.6.3",
    "eslint": "^8.19.0",
    "jest": "^29.6.3",
    "prettier": "2.8.8",
    "react-test-renderer": "18.2.0",
    "typescript": "5.0.4"
  },
  "engines": {
    "node": ">=18"
  }
}

Appart from that, the project is run on an android emulator (default installed with Android Studio)