Agontuk / react-native-geolocation-service

React native geolocation service for iOS and android
https://www.npmjs.com/package/react-native-geolocation-service
MIT License
1.6k stars 291 forks source link

Warning: `new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method #315

Closed paulintrognon closed 2 years ago

paulintrognon commented 2 years ago

Environment

System:
    OS: Linux 5.10 Ubuntu 20.04.1 LTS (Focal Fossa)
    CPU: (12) x64 Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz
    Memory: 2.48 GB / 30.97 GB
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 14.17.1 - ~/.nvm/versions/node/v14.17.1/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v14.17.1/bin/yarn
    npm: 6.14.13 - ~/.nvm/versions/node/v14.17.1/bin/npm
    Watchman: 20210821.022905.0 - /usr/local/bin/watchman
  SDKs:
    Android SDK:
      API Levels: 30, 31
      Build Tools: 30.0.2, 31.0.0
      System Images: android-28 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-31 | Google APIs Intel x86 Atom_64
      Android NDK: Not Found
  IDEs:
    Android Studio: AI-203.7717.56.2031.7621141
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.65.1 => 0.65.1 
  npmGlobalPackages:
    *react-native*: Not Found

Platforms

Android

Versions

Please add the used versions/branches

Description

When I include Geolocation in my app, I get warnings from the console:

 WARN  `new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.
 WARN  `new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.

Reproducible Demo

  1. npx react-native init SampleProject --template react-native-template-typescript
  2. cd SampleProject
  3. yarn add react-native-geolocation-service
  4. add import Geolocation from 'react-native-geolocation-service' and Geolocation; in App.tsx
  5. yarn react-native run-android
  6. See the warnings in the console

Expected Results

No warnings.

Thank you :slightly_smiling_face:

paulintrognon commented 2 years ago

Oh sorry, did not see https://github.com/Agontuk/react-native-geolocation-service/issues/301 :blush: