react-native-geolocation
react-native-geolocation copied to clipboard
Android : Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNCGeolocation' could not be found.
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
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