Possible Causes
The application does not have the ohos.permission.LOCATION permission.
Solution
The application can obtain the location information only when it has been granted the ohos.permission.LOCATION permission during development.
Reference
Open system_grant Permissions