Search code examples
androidmapshuawei-mobile-serviceshuawei-developershuawei-map-kit

HMS Map toolkit - onMapReady() not called after getMapAsync() calling


I am working with HMS Maps, for this I follow their documentation.
For this query I tried this link. I added SHA-256 key and agconnect-services.json file too.
The Steps which I did are:

dependency in app gradle: implementation 'com.huawei.hms:maps:6.0.0.301'
in app gradle: apply plugin: 'com.huawei.agconnect'
My root gradle is:

buildscript {
    repositories {
        maven { url 'http://developer.huawei.com/repo/' }
        google()
        jcenter()
        mavenCentral()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'com.huawei.agconnect:agcp:1.2.1.301'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven {url 'http://developer.huawei.com/repo/'}
        google()
        jcenter()
        mavenCentral()
        maven {
            url 'https://jitpack.io'
        }

        maven {
            url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
        }

    }
}

I added SHA-256 key at AppGallery connect.
Enabled MapApi from AppGallery connect.
Downloaded and added "agconnect-services.json" file in my project.

After resolving some thread related issues, I am able to produce logcat errors and it is saying that "Illegal FingerPrint".
I know, it is about some integration issues with the AppGallery but I am unable to get it that what I am missing, I am following all the steps.
**Logcat is:**
2021-08-31 10:35:22.520 30490-30773/com.moody.poster E/HmsMapKit_AuthenticateClient_1074: Exception occur
    com.huawei.hms.maps.foundation.client.d: *1*0*2*:*I*L*G*L*F*N*E*P*I*T
        at com.huawei.hms.maps.foundation.client.d$d.c(:89)
        at com.huawei.hms.maps.foundation.client.c.d(:22556)
        at com.huawei.hms.maps.foundation.client.c.c(:88)
        at com.huawei.hms.maps.maproute.client.auth.e.d(:76)
        at com.huawei.hms.maps.maproute.client.auth.e.a(Unknown Source:0)
        at com.huawei.hms.maps.maproute.client.auth.b.a(Unknown Source:4)
        at com.huawei.hms.maps.foundation.client.c$a.e(:492)
        at com.huawei.hms.maps.maproute.client.auth.e.c(:1074)
        at com.huawei.hms.maps.maproute.cache.c$b.e(:298)
        at com.huawei.hms.maps.maproute.cache.c$b.call(:291)
        at eU.a(:42)
        at em.d(:12025)
        at fc$b.run(:96)
        at eq$c.run(:571)
        at fj.run(:66)
        at fj.call(:57)
        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-08-31 10:35:22.528 30490-30773/com.moody.poster E/HmsMapKit_ErrorTraceLogPusher_509: cache error trace log : ErrorTraceLogDTO{ scenario = ACCESS_SERVICE_ERROR', message='010002 : ILLEGAL_FINGERPRINT'}
    com.huawei.hms.maps.foundation.client.d: *1*0*2*:*I*L*G*L*F*N*E*P*I*T
        at com.huawei.hms.maps.foundation.client.d$d.c(:89)
        at com.huawei.hms.maps.foundation.client.c.d(:22556)
        at com.huawei.hms.maps.foundation.client.c.c(:88)
        at com.huawei.hms.maps.maproute.client.auth.e.d(:76)
        at com.huawei.hms.maps.maproute.client.auth.e.a(Unknown Source:0)
        at com.huawei.hms.maps.maproute.client.auth.b.a(Unknown Source:4)
        at com.huawei.hms.maps.foundation.client.c$a.e(:492)
        at com.huawei.hms.maps.maproute.client.auth.e.c(:1074)
        at com.huawei.hms.maps.maproute.cache.c$b.e(:298)
        at com.huawei.hms.maps.maproute.cache.c$b.call(:291)
        at eU.a(:42)
        at em.d(:12025)
        at fc$b.run(:96)
        at eq$c.run(:571)
        at fj.run(:66)
        at fj.call(:57)
        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-08-31 10:35:22.536 30490-30773/com.moody.poster E/HmsMapKit_AuthenticateCache_333: other err occur,errorCode : .010002 : ILLEGAL_FINGERPRINT
2021-08-31 10:35:22.775 30490-30490/com.moody.poster E/HmsMapKit_AccessTraceLogPusher_16: analyticsInstance is null
2021-08-31 10:35:22.778 30490-30490/com.moody.poster E/HmsMapKit_UserEventLogPusher_16: analyticsInstance is null



Solution

  • I am not sure that why it is happening, I talked to Huawei developers regarding this issue, I was doing this in a fragment but when I tried this in an activity, it works perfectly. Now I am doing it in a separate Activity. (I created that activity with the built in method of HMS toolkit.)