Skip to content

HMSLocation.getFusedLocationProviderClient() result in Cannot read properties of undefined (reading 'getFusedLocationProviderClient') issue #120

@liuaf

Description

@liuaf

Description
HMSLocation.getFusedLocationProviderClient() result in Cannot read properties of undefined (reading 'getFusedLocationProviderClient') issue

Expected behavior
HMSLocation.getFusedLocationProviderClient() should return FusedLocationService Object

Current behavior
when I run below codes below result in above issue. Below is the code snippets:

import HMSLocation from "@hmscore/ionic-native-hms-location";

...
const fusedClient = HMSLocation.getFusedLocationProviderClient();
if(fusedClient != null){
fusedClient.getLastLocation({
needAddress : true,
language : "cn",
countryCode : "CN"
}).then((res) =>{
debugger;
console.log(res)
}).catch((err) => {
debugger;
console.log(err)
});
}

Screenshots
HMSLocation issue

Logs
Post logs here or paste them to Ghostbin and insert the link here.

Environment

  • Platform: [Ionic + Capacitor]
  • Kit: [Location, ionic-native-hms-location]
  • Kit Version [e.g. 5.0.3]
  • OS Version [e.g. Android 11]
  • Android Studio version (if applicable) [e.g. 4.1]
  • Platform version (Window10, Huawei Mate40 Pro HarmonyOS 3.0.0)
  • Node Version (if applicable)
  • Your Location/Region (Beijing, China)

Other
Add any other context about the problem here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions