HMS-Core / hms-xamarin-bindings

This repo contains all of Xamarin HMS plugins.
https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1
Apache License 2.0
36 stars 11 forks source link

Huawei.Hms.Map , HMS Map not rendering #8

Open tszenyew opened 2 years ago

tszenyew commented 2 years ago

Hi , i am trying to create an MapRenderer for Xamarin Android , i am using non Huawei Device with HMS Core 6.3.0.312 apk installed.

the problem is when i try to load the map , the map is not loaded and this appear in the application log.

[HMSSDK_HMSPackageManager] Enter getHMSPackageNameForMultiService
[HMSSDK_AGCUtils] Get appId with AGConnectServicesConfig failed
[HmsMapKit_HmsUtil_33] isInitialized is: falserepeatFlag is: true
[HmsMapKit_HmsUtil_33] hmsVersionStr 4.0.2.300
[HmsMapKit_HmsUtil_33] baseVersion 40002300
[HMSSDK_HMSPackageManager] Enter getHMSPackageName
[HMSSDK_HMSPackageManager] current versionCode:60300311, minimum version requirements: 40002300
[HMSSDK_HMSPackageManager] Enter getHMSPackageName
[HMSSDK_HMSPackageManager] Enter getHMSPackageName
[HMSSDK_HMSPackageManager] MinApkVersion is disabled.
[HmsMapKit_HmsUtil_33] Hms is :0
[HmsMapKit_HmsUtil_33] Hms is avaiable
[HmsMapKit_MapCreator_57] Making Createor dynamically
[dynamic-api_DynamicModule] 11481-11481|null|com.huawei.hms.feature.dynamic.DynamicModule|b|104|No available cached loader, query remote.
[dynamic-api_DynamicModule] 11481-11481|null|com.huawei.hms.feature.dynamic.DynamicModule|d|112|bundle info: errorCode:0, moduleVersion:60201300, modulePath:/data/user_de/0/com.huawei.hwid/files/modules/external/huawei_module_maps/60201300/Map-Route.apk, loader_version:60201300, loaderPath:/data/user_de/0/com.huawei.hwid/files/modules/external/huawei_module_maps/60201300/Map-Route.apk, armeabiType:0
[dynamic-api_DynamicModule] 11481-11481|null|com.huawei.hms.feature.dynamic.DynamicModule|c|84|The loader_path:/data/user_de/0/com.huawei.hwid/files/modules/external/huawei_module_maps/60201300/Map-Route.apk in query bundle is not available,change the module version to:-100
[dynamic-api_DynamicModule] 11481-11481|null|com.huawei.hms.feature.dynamic.DynamicModule|b|223|failed to load.
[dynamic-api_DynamicModule] java.lang.NullPointerException
[dynamic-api_DynamicModule]     at com.huawei.hms.common.util.Logger.a(Unknown Source:27)
[dynamic-api_DynamicModule]     at com.huawei.hms.common.util.Logger.w(Unknown Source:9)
[dynamic-api_DynamicModule]     at com.huawei.hms.feature.dynamic.DynamicModule.b(Unknown Source:223)
[dynamic-api_DynamicModule]     at com.huawei.hms.feature.dynamic.DynamicModule.getRemoteModuleInfo(Unknown Source:41)
[dynamic-api_DynamicModule]     at com.huawei.hms.feature.dynamic.a.e.getModuleInfo(Unknown Source:0)
[dynamic-api_DynamicModule]     at com.huawei.hms.feature.dynamic.DynamicModule.load(Unknown Source:22)
[dynamic-api_DynamicModule]     at com.huawei.hms.maps.mbu.b(Unknown Source:8)
[dynamic-api_DynamicModule]     at com.huawei.hms.maps.mbu.a(Unknown Source:15)
[dynamic-api_DynamicModule]     at com.huawei.hms.maps.MapView$maa.createDelegate(Unknown Source:57)
[dynamic-api_DynamicModule]     at com.huawei.hms.feature.dynamic.DeferredLifecycleHelper.a(Unknown Source:44)
[dynamic-api_DynamicModule]     at com.huawei.hms.feature.dynamic.DeferredLifecycleHelper.onCreate(Unknown Source:5)
[dynamic-api_DynamicModule]     at com.huawei.hms.maps.MapView.onCreate(Unknown Source:29)
[dynamic-api_DynamicModule]     at crc64720bb2db43a66fe9.FragmentContainer.n_onCreateView(Native Method)
[dynamic-api_DynamicModule]     at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
[dynamic-api_DynamicModule]     at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
[dynamic-api_DynamicModule]     at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
[dynamic-api_DynamicModule]     at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
[dynamic-api_DynamicModule]     at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
[dynamic-api_DynamicModule] 11481-11481|null|com.huawei.hms.feature.dynamic.DynamicModule|getLocalVersion|90|Cannot find the class of module descriptor for huawei_module_maps
[dynamic-api_e] 11481-11481|null|com.huawei.hms.feature.dynamic.a.e|getModuleInfo|90|Cannot get module info in remote or local.
[HmsMapKit_MapCreator_8] getRemoteContext: DynamicModule load failedcom.huawei.hms.feature.dynamic.DynamicModule$LoadingException: Query remote version and local version failed.
[HmsMapKit_MapCreator_57] getRemoteMapContext failed
[HmsMapKit_MapView_-2] getMapAsync: 

if i switch to Xamarin.Android.Huawei.Hms.Map package from https://www.nuget.org/packages/Xamarin.Android.Huawei.Hms.Maps/ , then the map will load fine. But i am using Huawei.Hms.SafetyDetect package in my project too , so i have to use this HMS Map package, otherwise it will have reference conflict on AGConnectServicesConfig class. Please help.

here is project package without Huawei.Hms.SafetyDetect installed.

Screenshot 2022-01-14 at 10 11 45 AM
johnthiriet commented 2 years ago

Hello @tszenyew,

For our own projects, I had to upgrade the bindings the HMS 6. It's on a different branch on my repo and I published the nugets. I have added SafetyDetect since it was fairly easy to do but I mostly did not test it. Feel free to give it a try or modify the bindings for your needs.

I would always recommend using official bindings from the provider, unfortunately, Hms official bindings do not fit my needs in terms of compatibility or speed. When their bindings will be up to date, please use them instead.

Kind regards,