【问题标题】:HMS Map toolkit - issue rendering a MapHMS Map toolkit - 渲染地图的问题
【发布时间】:2021-10-14 08:17:08
【问题描述】:

尝试将 HMS 地图添加到我的应用程序(GMS 工作正常)我遇到了渲染地图的问题。 地图片段仅为可见区域加载地图,移动地图或缩小地图仅在灰色网格中可见。 (我尝试使用来自华为官方 codlab 的活动和代码对其进行测试 - 并遇到同样的问题) 我在华为开发者论坛(https://forums.developer.huawei.com/forumPortal/en/topic/0201611224212740063)找到了同样的案例,但没有任何解决方案。

如果我使用带有位置和地址定义的片段,我什至可以获取地址 - 但可以看到地图。

错误日志:

2021-10-14 12:56:27.263 17509-17509/ru.my.app E/HmsMapKit_ContextDataInitializer_42: error occur when get support China flag from sdk through method reflection.

2021-10-14 12:56:28.214 17509-17660/ru.my.app E/HmsMapKit_AuthenticateClient_27: Exception occur
com.huawei.hms.maps.foundation.client.c: *1*0*2*:*I*L*G*L*F*N*E*P*I*T
    at com.huawei.hms.maps.foundation.client.c$a.b(Unknown Source:25)
    at com.huawei.hms.maps.foundation.client.b.a(Unknown Source:20)
    at com.huawei.hms.maps.foundation.client.b.c(Unknown Source:80)
    at com.huawei.hms.maps.foundation.client.b.a(Unknown Source:88)
    at com.huawei.hms.maps.foundation.client.b.a(Unknown Source:1)
    at com.huawei.hms.maps.maproute.client.auth.a.m(Unknown Source:2)
    at com.huawei.hms.maps.maproute.client.auth.a.lambda$4mAmyqJJeLxpXtGhAREgNcSN3PY(Unknown Source:0)
    at com.huawei.hms.maps.maproute.client.auth.-$$Lambda$a$4mAmyqJJeLxpXtGhAREgNcSN3PY.call(Unknown Source:4)
    at com.huawei.hms.maps.foundation.client.b$a.a(Unknown Source:3)
    at com.huawei.hms.maps.maproute.client.auth.a.b(Unknown Source:27)
    at com.huawei.hms.maps.maproute.client.auth.a.a(Unknown Source:4)
    at com.huawei.hms.maps.maproute.cache.a$a.a(Unknown Source:17)
    at com.huawei.hms.maps.maproute.cache.a$a.call(Unknown Source:0)
    at oe.b(Unknown Source:17)
    at ml.a(Unknown Source:14)
    at oi$b.run(Unknown Source:6)
    at mo$a.run(Unknown Source:9)
    at ou.run(Unknown Source:13)
    at ou.call(Unknown Source:0)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:929)

2021-10-14 12:56:28.218 17509-17660/ru.my.app E/HmsMapKit_ErrorTraceLogPusher_4: cache error trace log : ErrorTraceLogDTO{ scenario = ACCESS_SERVICE_ERROR', message='010002 : ILLEGAL_FINGERPRINT'}
com.huawei.hms.maps.foundation.client.c: *1*0*2*:*I*L*G*L*F*N*E*P*I*T
    at com.huawei.hms.maps.foundation.client.c$a.b(Unknown Source:25)
    at com.huawei.hms.maps.foundation.client.b.a(Unknown Source:20)
    at com.huawei.hms.maps.foundation.client.b.c(Unknown Source:80)
    at com.huawei.hms.maps.foundation.client.b.a(Unknown Source:88)
    at com.huawei.hms.maps.foundation.client.b.a(Unknown Source:1)
    at com.huawei.hms.maps.maproute.client.auth.a.m(Unknown Source:2)
    at com.huawei.hms.maps.maproute.client.auth.a.lambda$4mAmyqJJeLxpXtGhAREgNcSN3PY(Unknown Source:0)
    at com.huawei.hms.maps.maproute.client.auth.-$$Lambda$a$4mAmyqJJeLxpXtGhAREgNcSN3PY.call(Unknown Source:4)
    at com.huawei.hms.maps.foundation.client.b$a.a(Unknown Source:3)
    at com.huawei.hms.maps.maproute.client.auth.a.b(Unknown Source:27)
    at com.huawei.hms.maps.maproute.client.auth.a.a(Unknown Source:4)
    at com.huawei.hms.maps.maproute.cache.a$a.a(Unknown Source:17)
    at com.huawei.hms.maps.maproute.cache.a$a.call(Unknown Source:0)
    at oe.b(Unknown Source:17)
    at ml.a(Unknown Source:14)
    at oi$b.run(Unknown Source:6)
    at mo$a.run(Unknown Source:9)
    at ou.run(Unknown Source:13)
    at ou.call(Unknown Source:0)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

2021-10-14 12:56:28.225 17509-17660/ru.my.app E/HmsMapKit_AuthenticateCache_163: other err occur,errorCode : .010002 : ILLEGAL_FINGERPRINT

2021-10-14 12:56:28.293 17509-17717/ru.my.app E/HmsMapKit_TileCache_38: startUrlRequest Identity fail, do not has permission get tile. authResult :010002

2021-10-14 12:56:28.380 17509-17509/ru.my.app E/HmsMapKit_TileCache_19:  tile parse callback , error report. status is 409
2021-10-14 12:56:28.381 17509-17509/ru.my.app E/HmsMapKit_ErrorTraceLogPusher_4: cache error trace log : ErrorTraceLogDTO{ scenario = RIEMANN_ENGINE_ERROR', message='map network request interrupt map network request interrupt'}

所以,我很确定:

  • Gradle 中的所有依赖项和 otert 都是正确的
  • 我将 agconnect-servoces.json 添加到我的项目中
  • 项目和AppGallery Connect中的包名相同
  • 应用中存在证书指纹
  • 我将正确的 SHA-256 添加到 AppGallery Connect

我尝试清除应用程序和 HMS Core 的现金 - 没有任何变化。

最后一个问题是我不能在官方论坛写问题,因为我的国家不支持。

【问题讨论】:

    标签: android maps huawei-mobile-services huawei-developers huawei-map-kit


    【解决方案1】:

    根据以下日志:

    发生其他错误,错误代码:.010002 : ILLEGAL_FINGERPRINT

    可能的原因如下:

    • 您的项目中的应用 ID 与 AppGallery Connect 中的不同。
    • 未配置签名证书指纹。您需要生成签名证书指纹并在 AppGallery Connect 中进行配置。
    • 您的应用的AppGallery Connect配置文件未配置。您需要按照Adding the AppGallery Connect Configuration File of Your App 中的说明进行配置。
    • API 密钥未使用 encode 进行转码。

    详情可以参考this Docs

    还建议您使用配置向导完成环境配置,它会自动帮您添加指纹。你可以参考this Docs

    【讨论】:

    • 非常感谢!问题是 HMS 希望我选择团队名称、项目模块等,并仅从 HMS Toolkit 插件生成 SHA-256 证书指纹。当我在网站 AppGalleyConnect 上做同样的事情时,这还不够。
    • 感谢您的反馈,请问您是否使用了配置向导进行了配置,但仍然不能?能否请您提供使用过程中的截图?
    • 现在一切正常。据我所知,昨天我无法通过网站(AppGallery Connect)添加sha-256:当我按下复选标记时,文本字段闪烁并消失;我认为,没关系,但确实如此。托达尔我可以在那里看到我的指纹。并且可以通过HMS Toolkit生成和添加)
    • 太棒了!随意接受答案。注意:如果您有任何疑问,请随时与我们联系。?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-12-13
    • 1970-01-01
    • 2020-11-06
    • 2014-02-02
    • 1970-01-01
    • 2016-06-04
    • 1970-01-01
    相关资源
    最近更新 更多