Search code examples
androidhuawei-mobile-serviceshuawei-developershuawei-location-kit

Can't use huawei mobile services on the new Huawei devices


I'm developing an android project.I want to integrate Huawei mobile services for Huawei devices without google play services. in this project I have developed but when I test it for Huawei P40 in cloud debugging environment, Huawei mobile services don't work.It works when i test it on Huawei mate 10 pro.Huawei mobile services location kit not reacting at p40. How can i solve this please help me


Solution

  • Update:

    I got the following message in Logcat. Message is; I/Last Location: Last location is null!

    1. Please check whether getLastLocation obtains location information from the system cache. If it does, the obtained location is null when the system cache has been cleared. In this case, call requestLocationUpdates to cache the current location. Then, you can obtain the location information by calling getLastLocation.

    Here is the HMS Core Location Kit demo on github here. Please update to the latest version :)


    1. Please ensure that the location permission has been assigned to the HMS Core app. Go to Settings > Apps > Apps and find the HMS Core app. (The menu path may vary depending on the operating system version. If you cannot find the app, tap the menu icon in the upper right corner of Apps and tap Show system processes.) Then, tap the HMS Core icon, go to App info > Permissions > Location, and verify that the location permission is assigned to HMS Core.
    2. You probably cannot use the high-precision location service as it is currently supported only on HUAWEI P40 series and is available only in the Chinese mainland.
    3. Activity identification and geofence are not supported on emulators.
    4. If the error persists, please provide us with logs of the fault.

    You can perform the following operations to capture the logs:

    1). Run the following command to connect to the device adb logcat –v time > D:\hwlocation.log

    2). Reproduce the fault.

    3).Press Ctrl+C.

    In addition, record the device model, EMUI version, HMS Core version, integrated SDK version, and fault reproduction procedure so that technical personnel can help you quickly troubleshoot the fault.