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

Illegal callback invocation from native module. This callback type only permits a single invocation from native code #335

Closed Avishayy closed 2 years ago

Avishayy commented 2 years ago

Environment

info Fetching system and libraries information...
System:
    OS: macOS 11.6
    CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
    Memory: 6.32 GB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.5.0 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.4.1 - ~/Projects/project/node_modules/.bin/npm
    Watchman: 2022.02.14.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
    Android SDK:
      Android NDK: 21.4.7075529
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7583922
    Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.10 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.67.2 => 0.67.2
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Platforms

Android

Versions

Please add the used versions/branches

Description

I've had a Crashlytics crash in the library, here's the stack trace:

Fatal Exception: java.lang.RuntimeException: Illegal callback invocation from native module. This callback type only permits a single invocation from native code.
       at com.facebook.react.bridge.CallbackImpl.invoke(CallbackImpl.java)
       at com.agontuk.RNFusedLocation.RNFusedLocationModule$1.onLocationChange(RNFusedLocationModule.java)
       at com.agontuk.RNFusedLocation.FusedLocationProvider$1.onLocationAvailability(FusedLocationProvider.java)
       at com.google.android.gms.internal.location.zzau.notifyListener(zzau.java)
       at com.google.android.gms.common.api.internal.ListenerHolder.getListenerKey(ListenerHolder.java)
       at com.google.android.gms.common.api.internal.zacb.run(zacb.java)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:158)
       at android.app.ActivityThread.main(ActivityThread.java:7229)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Reproducible Demo

I don't have one, sorry

Expected Results

No crash

cristianoccazinsp commented 2 years ago

Seeing the same issue, should mark this as "Urgent" in the label or something.

java.lang.RuntimeException: Illegal callback invocation from native module. This callback type only permits a single invocation from native code.
        at com.facebook.react.bridge.CallbackImpl.invoke(CallbackImpl.java:26)
        at com.agontuk.RNFusedLocation.RNFusedLocationModule$1.onLocationError(RNFusedLocationModule.java:91)
        at com.agontuk.RNFusedLocation.FusedLocationProvider$2.run(FusedLocationProvider.java:70)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6702)
        at java.lang.reflect.Method.invoke(Method.java:-2)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)

@Agontuk any ideas?

Agontuk commented 2 years ago

@Avishayy @cristianoccazinsp , can you try the latest changes in master branch ? I rewrote the location listener logic, hopefully it'll solve the issue

cristianoccazinsp commented 2 years ago

@Agontuk seems to be working. Although I haven't been able to fully reproduce the crash, but rather I'm seeing it through crash logs on some android devices. @Avishayy can you help test? Were you able to fully reproduce the crash?

cristianoccazinsp commented 2 years ago

Can we get the fix released?

pedrolopes10 commented 2 years ago

@Agontuk i can confirm that latest changes in master branch will fix it.

menusha95 commented 2 years ago

@Agontuk Is it possible to release this fix?

Subhimaraabe commented 2 years ago

@Agontuk can we release the fix to this issue plz

curiouscosmos commented 2 years ago

This breaks the app. Need fix asap.

cristianoccazinsp commented 2 years ago

@Agontuk any ideas when this will be released?

Agontuk commented 2 years ago

v5.3.0 published in npm. Closing the issue.

DodoSpringLove commented 2 years ago

v5.3.0 published in npm. Closing the issue.

Hi. are soure fixed it?