googlemaps / react-native-navigation-sdk

Apache License 2.0
25 stars 5 forks source link

mapViewController.getMyLocation is crashing the app on Android #196

Closed nexttrack07 closed 3 months ago

nexttrack07 commented 3 months ago

Anytime we try to call the mapViewController.getMyLocation on an Android device, the app goes unresponsive and crashes soon after.

Note: This is a very critical issue for us since we need to get the user location. It is working perfectly in iOS. I was also able to reproduce this in the SampleApp provided in this repo.

Environment details react-native-navigation-sdk : 0.3.4-beta Android 33 Note: Occurs on both physical/virtual Android. (Bug doesn't exist in iOS)

Steps to reproduce

illuminati1911 commented 3 months ago

@nexttrack07 Thanks for reporting this.

illuminati1911 commented 3 months ago

@nexttrack07 I just tested this in the example app with the same SDK and Android version but for me it worked fine.

Maybe there is some location related data that the SDK can't handle in the location of your device?

  1. Could you share the location (= coordinates) where you get crash? Alternatively or in addition, could you test if it works in other locations? Maybe mock your simulator to e.g. SF or Tokyo downtown.
  2. When you got this crash in the example app, did you just simply open it and tap the "get my location" button in the map menu? Screenshot 2024-07-17 at 16 58 45
nexttrack07 commented 3 months ago

Thank for this. I was able to figure out the issue. We were setting mapViewController.setMyLocationEnabled(false) for some reason and then calling mapViewController.getMyLocation() function which was crashing the app in Android. However, this worked with no issues on iOS.

illuminati1911 commented 3 months ago

@nexttrack07 Great to hear you got it working. That being said the app still shouldn't crash even if "my location" is disabled. We'll improve error handling and fix this in the next release.

Closing. If you face any new issues please open a new ticket.

illuminati1911 commented 3 months ago

@nexttrack07 We have now new release available 1.0.0-beta. It should fix this issue.

Edit: The release number has been changed to 0.4.0-beta.