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

Cannot generate signing certificate sha 256 for Huawei Map Kit


I am trying to migrate Google Map to Huawei Map kit. Now I should generate local SHA 256 fingerprint for Huawei App Gallery and I am following this official documentation provided by HUAWEI: Configuring App Gallery Connect

  1. I created my project in App Gallery
  2. I already added my app to that project
  3. I downloaded agconnect-servises.json file
  4. I generated the .jks certificate in Android Studio
  5. Then, for generating a signing certificate fingerprint for adding to Huawei App Gallery In the cmd prompt I went to the directory where the JDK installed, then opened bin directory and ran the command: keytool -list -v -keystore <my .jks file path>

Instead of getting the result which official doc. provided I am getting the following result in cmd.

enter image description here

I searched a lot and did not find any single information about this. What should I do to get the certificate?


Solution

  • The keytool command requires the addition of more options to get your SHA256. Here is the correct command with the additional options.

    keytool -list -v -keystore <keystore path> -alias <key alias> -storepass <keystore password>
    

    While using the keytool is necessary in getting the SHA256, the Java keytool is a utilty created by Oracle and is not exclusive to the process of publishing on the Huawei AppGallery. Please refer to the official documentation for more information: Link