Driversnote-Dev / react-native-kontaktio

React Native (iOS and Android) library for Kontakt.io beacons (and all other beacons)
MIT License
112 stars 48 forks source link

null is not an object (evaluating 'KontaktModule.stopDiscovery') #65

Closed startamovement closed 4 years ago

startamovement commented 4 years ago

installed via cocoapods and also tried using the ios installation. anytime i declare Kontact, i get the error in the title.

startamovement commented 4 years ago

Somehow got passed that error. But anytime i call startDiscovery it crashes. Any ideas?

nollymar commented 4 years ago

I got the same issue. This is what I see in the log:

2019-10-10 18:16:00.126808-0500 ReactBeaconsPOC[2680:1196381] [] nw_socket_handle_socket_event [C3.1:1] Socket SO_ERROR [61: Connection refused]
2019-10-10 18:16:00.128550-0500 ReactBeaconsPOC[2680:1196381] [] nw_socket_handle_socket_event [C3.2:1] Socket SO_ERROR [61: Connection refused]
2019-10-10 18:16:00.139703-0500 ReactBeaconsPOC[2680:1196389] [] nw_connection_get_connected_socket [C3] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-10-10 18:16:00.139783-0500 ReactBeaconsPOC[2680:1196389] TCP Conn 0x2807398c0 Failed : error 0:61 [61]
2019-10-10 18:16:02.874 [error][tid:com.facebook.react.JavaScript] TypeError: null is not an object (evaluating 'KontaktModule.stopDiscovery')
2019-10-10 18:16:02.888 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: TypeError: null is not an object (evaluating 'KontaktModule.stopDiscovery')
2019-10-10 18:16:02.907 [error][tid:com.facebook.react.JavaScript] Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
2019-10-10 18:16:02.947 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
2019-10-10 18:16:02.955988-0500 ReactBeaconsPOC[2680:1196382] [] nw_socket_handle_socket_event [C5:1] Socket SO_ERROR [61: Connection refused]
2019-10-10 18:16:02.957106-0500 ReactBeaconsPOC[2680:1196388] [] nw_connection_get_connected_socket [C5] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-10-10 18:16:02.957527-0500 ReactBeaconsPOC[2680:1196388] TCP Conn 0x2807395c0 Failed : error 0:61 [61]
startamovement commented 4 years ago

I got the same issue. This is what I see in the log:

2019-10-10 18:16:00.126808-0500 ReactBeaconsPOC[2680:1196381] [] nw_socket_handle_socket_event [C3.1:1] Socket SO_ERROR [61: Connection refused]
2019-10-10 18:16:00.128550-0500 ReactBeaconsPOC[2680:1196381] [] nw_socket_handle_socket_event [C3.2:1] Socket SO_ERROR [61: Connection refused]
2019-10-10 18:16:00.139703-0500 ReactBeaconsPOC[2680:1196389] [] nw_connection_get_connected_socket [C3] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-10-10 18:16:00.139783-0500 ReactBeaconsPOC[2680:1196389] TCP Conn 0x2807398c0 Failed : error 0:61 [61]
2019-10-10 18:16:02.874 [error][tid:com.facebook.react.JavaScript] TypeError: null is not an object (evaluating 'KontaktModule.stopDiscovery')
2019-10-10 18:16:02.888 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: TypeError: null is not an object (evaluating 'KontaktModule.stopDiscovery')
2019-10-10 18:16:02.907 [error][tid:com.facebook.react.JavaScript] Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
2019-10-10 18:16:02.947 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
2019-10-10 18:16:02.955988-0500 ReactBeaconsPOC[2680:1196382] [] nw_socket_handle_socket_event [C5:1] Socket SO_ERROR [61: Connection refused]
2019-10-10 18:16:02.957106-0500 ReactBeaconsPOC[2680:1196388] [] nw_connection_get_connected_socket [C5] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-10-10 18:16:02.957527-0500 ReactBeaconsPOC[2680:1196388] TCP Conn 0x2807395c0 Failed : error 0:61 [61]

running react-native link react-native-kontaktio fixed that error for me. I still can't call startDiscovery without it crashing, but at least startRangingBeaconsInRegion works.

nollymar commented 4 years ago

I unlinked and linked react-native-kontakio again but it didn't work. What version of react-native are you using?

startamovement commented 4 years ago

I unlinked and linked react-native-kontakio again but it didn't work. What version of react-native are you using?

0.59.8.

React Native Environment Info:
    System:
      OS: macOS 10.14.6
      CPU: (4) x64 Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
      Memory: 69.69 MB / 32.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.15.3 - /usr/local/bin/node
      Yarn: 1.3.2 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
      Android SDK:
        API Levels: 23, 25, 26, 27, 28
        Build Tools: 27.0.3, 28.0.3
        System Images: android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5314842
      Xcode: 10.2/10E125 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.8 => 0.59.8 
    npmGlobalPackages:
      react-native-cli: 2.0.1
nollymar commented 4 years ago

Thanks @startamovement . I couldn't make it work. So, I decided to implement the logic in Swift using the Kontakt.io sdk and created my own react native bridge. It wasn't difficult to implement and now I'm able to discover, range and monitor my beacons.

startamovement commented 4 years ago

@nollymar glad you were able to get it working. i'll have to try your solution to get discover working for me. thanks!

jdiasundercover commented 4 years ago

I have the same problem. Any one know how to solve this ?

michaeltong88 commented 4 years ago

Please downgrade the React Native to 0.59.x

izaa commented 4 years ago

@nollymar could you share your code please? Would help a lot :) thanks!

andrekovac commented 4 years ago

Autolinking is now supported with PR #67 which just got merged