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