Solution to the failure of loading AG Google Maps on an application

[Problem background]: Google Maps failed to load after a developer app was put on the Huawei App Market. The same package has been put on the Google Store without any problems.

【problem analysis】:

The test log of the crawling application loading Google Maps indicates that the authentication failed:

10-07 14:25:25.641 3061 3397 E Google Maps Android API: API Key: AIzaSyA2wHvbJd8P46jl1DLXRAlv3B5yIKCNDyE
10-07 14:25:25.641 3061 3397 E Google Maps Android API: Android Application (<cert_fingerprint>;<package_name>): D3:98:30:D7:75:FD:25:0E:DC:FA:0E:D5:30:DE:E0:BC:38:20:6D:D9;de.hafas.android.db

10-07 14:25:25.641 3061 3397 E Google Maps Android API: Authorization failure. Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.

The certificate fingerprint in the log is the SHA1 certificate fingerprint of the application signature. It can be seen that the reason for the failure to load Google Maps is that the certificate fingerprint cannot be obtained. After further checking the Google Maps integration problem, it is found that the SHA1 certificate fingerprint needs to be configured, and the developer uses it The signature service of the Huawei system has been changed, and the fingerprint of the certificate has changed. This is the root cause of the problem.

【solution】:

Solution 1: Obtain a new SHA1 certificate fingerprint and reintegrate Google Maps.

1. Due to the security red line requirements of Huawei, the SHA1 certificate fingerprint printing is not provided for the time being, but it can be obtained by downloading the certificate, logging in to AGC, entering the application signature tab, and downloading the application signature certificate:

Insert picture description here

2. Execute openssl command to print output directly:

Insert picture description here

3. Reconfigure the SHA1 certificate fingerprint according to the Google Maps integration document:

link:https://developers.google.com/maps/documentation/android-sdk/get-api-key?hl=zh-cn

Option 2: Directly use the signature file when it was launched on the Google Store.

The developer directly uses the same signature certificate as the Google Store. There is no need to reconfigure, just choose to upload your own signature file when you select the "application signing" service, as follows:

Insert picture description here


Original link:https://developer.huawei.com/consumer/cn/forum/topic/0201411981231120393?fid=0101271690375130218

Author: Mayism

Guess you like

Origin blog.51cto.com/14772288/2637098