Closed megaacheyounes closed 4 months ago
Hello @megaacheyounes Huawei Flutter Location plugin is a wrapper around Huawei Location SDK and currently, Huawei Location SDK does not support Android 14. For any questions related to Native SDKs please submit a ticket online.
same issue
Description when initializing Location Kit on Android 14, the initializer function tries to register a broadcast receiver which throws an exception:
throw exception :
The code responsible for the exception is here: https://github.com/HMS-Core/hms-react-native-plugin/blob/master/react-native-hms-location/android/src/main/java/com/huawei/hms/rn/location/backend/helpers/HMSBroadcastReceiver.java#L159
To solve this, we simply need to pass third parameter, as this is a local broadcast receiver that does not receive broadcasts from other apps, we can pass RECEIVER_NOT_EXPORTED, example:
Android docs: https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)
I understand location kit works only on Huawei phones, which may not support Android 14 yet, but its still an issue that needs to be fixed.
Thanks .