Error in exporting APK key key based on Baidu map program eclipse

Source: Internet
Author: User
Tags sha1



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






Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.