react-native-geolocation icon indicating copy to clipboard operation
react-native-geolocation copied to clipboard

Android : Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNCGeolocation' could not be found.

Open pankaj-bhardwaj opened this issue 11 months ago • 6 comments

Environment

"react": "18.3.1",
"react-native": "0.76.4",
"@react-native-community/geolocation": "^3.4.0",

Platforms

Android

Versions

  • Android: 31
  • react-native-geolocation: "^3.4.0",
  • react-native: "0.76.4",
  • react: "18.3.1",

Description

Created new react native project using cli comand and run it on the android emulator and ios simulator. After install the this npm and do the code as below

import GeoLocation from '@react-native-community/geolocation';

GeoLocation.setRNConfiguration({ skipPermissionRequests: false, authorizationLevel: 'always', enableBackgroundLocationUpdates: true, locationProvider: 'auto', });

GeoLocation.requestAuthorization();

Using ths above code snippet on iOS it is working as expected but android app is crashing, as below

Screenshot 2024-12-08 at 4 31 57 PM Screenshot 2024-12-08 at 4 38 44 PM

Reproducible Demo

  • Create new react native application - npx @react-native-community/cli@latest init AwesomeProject
  • Install this npm - yarn add @react-native-community/geolocation (also tried with recommended npm command)
  • Added above code snippet
  • Run the app on the android simulator

pankaj-bhardwaj avatar Dec 08 '24 11:12 pankaj-bhardwaj