Current location - Quotes Website - Signature design - How to solve the signature problem of Baidu map developed by android
How to solve the signature problem of Baidu map developed by android
I believe that when many people are developing Baidu maps, Baidu maps will sometimes fail to load and only display the grid map. The reason for this problem is that there is something wrong with the SHA1, that is, the fingerprint certificate, filled in when applying for Baidu key. It is estimated that many developers apply according to the process introduced on Baidu's open platform.

of course, it is right to apply according to Baidu's open platform. However, the fingerprint certificate obtained by the application described above is only the fingerprint certificate of the default signature file debug.keystore existing in the local development environment. The process is as follows:

Step 1: Open a command window and enter cd.android.. (This step shows that the default signature certificate debug.keystore in the development environment is stored in the C drive. android directory)

Step 2: After entering the. android directory, enter keytool-list-v-keystore debug.keystore, where debug. keystore is the default signature file in the development environment.

It is worth noting that when we develop an apk and publish it in the app store, we need our own generated signature file. This signature file is definitely different from the default signature file of the development environment, at least the fingerprint certificate SHA1 is different. Therefore, when we export the signed apk through the signature file generated by ourselves, the key of Baidu map should be the fingerprint certificate in our own signature file. If we still use the key applied by SHA1 of debug.keystore, Baidu map will naturally have problems. For example, the name of the signature file we export apk is myapp.keystore; Then you can get SHA1 by typing keytool-list-v-keystoremyapp. keystore in the command window, and then apply for Baidu key through this SHA1, so that the Baidu map function of your exported signature apk will not only show the grid map but not load the map.

in short: if you use the apk with Baidu map function, and it only runs through the local environment, you can completely obtain SHA1 according to the process introduced on Baidu's open platform. However, if you develop an apk, you need to export the signature file (signature certificate) generated by yourself and put it in the application store for others to download. Then, the SHA1 value of the Baidu map key you apply for should come from the signature file you generated, and the SHA1 view method is keytool -list -v -keystore signature file. (Be careful to enter the path where the file is located before entering the command)