Recently based on the Baidu Map SDK wrote a demo, in the Eclipse on the real machine test is normal operation, no problem, but when I export apk installed on the phone, but found that the map is white lattice, the debugging found that the program did not visit Baidu map background failure, I found out it was a key and something went wrong.
Through repeated debugging, originally packaged into the APK, Eclipse's application for the key SHA1 changed
This is Eclipse's original SHA1
When the APK was packaged, SHA1 changed, showing
Since we are using the SHA1 of figure one to apply for key keys, there is no problem when the real machine runs on Eclipse, but when we pack into the APK process, SHA1 becomes two, we have previously applied the key has no way to access, so error, So how do we fix it?
Very simple, when we pack the APK, according to figure two SHA1 re-request a key keys, and then in the code to modify the access key can be successfully run to visit Baidu Map backstage
Error in exporting APK key key based on Baidu map program eclipse