ERROR/MapActivity(258): Couldn't get connection factory client

今天在调用google地图的时候,发现不显示地图数据,报以上错误,已经申请了apiKey。后在官方文档中看到答案:

For instructions, read Obtaining a Maps API Key. For the purpose of this tutorial, you should register with the SDK debug certificate, which will only be valid while your application is signed with the debug key (once you sign with your private key, you will need a new API key). When you get your key, insert it for the value of android:apiKey.

大概是说,调试时候使用的apikey跟最终发布版本时候的apikey是不一样的,而apikey的使用是必须与当前生成app的keystore相匹配的。因此debug模式,需要重新生成apikey。首先找到debug.keystore的位置:


  • Windows Vista: C:\Users\<user>\.android\debug.keystore
  • Windows XP: C:\Documents and Settings\<user>\.android\debug.keystore
  • OS X and Linux: ~/.android/debug.keystore调用以下命令生成新的md5:

    $ keytool -list -alias androiddebugkey \
    -keystore <path_to_debug_keystore>.keystore \
    -storepass android -keypass android
    再到google官方申请apiKey,然后在mapview中,指定使用该apikey即可。

  • 你可能感兴趣的:(android,api,Google,user,application,insert)