Android Baidu map Helloword Run exception handling

Source: Internet
Author: User
Tags sha1

Android Novice Baidu Map Helloword run abnormal, all the steps are in accordance with the official Baidu operation, but the start of the error, And these errors are outrageous. Later the official sample program is also related to the error, and finally found that the main problem is that the AVD version is not compatible with the SDK version, and the map of the AK signature needs to be obtained by the system cmd instead of Eclipse (the two methods obtained SHA1 signature inconsistency).

1.AVD version does not correspond to the Android SDK version causes the program not to start up

SOURCE See here: Http://developer.baidu.com/map/wiki/index.php?title=androidsdk/guide/hellobaidumap, error is as follows:

Looking for a long time actually is not the problem of the API, is not the problem of the program, but the AVD simulator problem, I use Android 4.4.W so the virtual machine also to create the same version, or it is like the unexpected things happen.

2. Signature Verification failed call Map API map could not be displayed

Always appear as shown in the interface:

This is caused by a mismatch in the SHA1 signature. Baidu app created by the project and the AK deleted re-created, to get a new AK. ak Generation method See:http://developer.baidu.com/map/sdkandev-14.htm, cmd way to get to SHA1 AK.

3. Test the re-registered AK

Add the following code to the Androidmanifest.xml:

   <application        android:allowbackup= "true"        android:icon= "@drawable/ic_launcher"        android:label= "@ String/app_name "        android:theme=" @style/apptheme ">        <!--configuration Baidu map Key--and        <meta-data            Android:name= "Com.baidu.lbsapi.API_KEY"            android:value= "gackizmon99vb7udewfrlv3b"/>            ......................

To start the AVD test, Test success as follows:

?

Note: Oschina (open source China) on some people said Baidu official online API update is not timely, so that the program can not run up, this may not be the case, do not put all the problems attributed to the Baidu map itself, otherwise it will prevent their growth and improve, more from their own point of view, The best practice is to use tools to identify problems and find a breakthrough.


Android Baidu map Helloword Run exception handling

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.