javaandroidgoogle-nearbygoogle-nearby-connections

Nearby Connection : Discovery issues on Android 10


For one of my project I work with Nearby Connection API with P2P_STAR strategy and I experience issue on discovery with Android 10. I have tested with Huawei devices that resulted in no connection at all with host and on a freshly updated Xiaomi MI 9t who success to connect but disconnect few seconds after with no exceptions... Before the update it work well on the Xiaomi. Furthermore, my app work very well on my android 8 or 9 devices.

I tried to add ACCESS_FINE_LOCATION permission and update Google play services without success...

Our project repository : https://github.com/hbollon/Urbalog All Nearby stuff is in NetworkHelper class and permissions list is in the constant REQUIRED_PERMISSIONS inside it.

Someone would have any idea? Thanks in advance


Solution

  • So I have found the issue, on my android 10 devices I haven't activate location and Nearby seems unable to activate it itself... I never notice that before Android 10 update so is it os related or have I always activated it before? I don't know ^^

    However, on the ConnectionsStatusCodes documentation, MISSING_SETTING_LOCATION_MUST_BE_ON status code is marked as deprecated ( https://developers.google.com/android/reference/com/google/android/gms/nearby/connection/ConnectionsStatusCodes ). So I imagine this is no longer a possible case no?