在不同设备授权失败(Android的谷歌地图API第2版)不同、地图、设备、Android

2023-09-08 00:01:09 作者:爷那叫范儿

我成功地在我的平板电脑(华硕TF201)的应用程序运行谷歌地图。但是,它不能在我的其他Android手机(三星,HTC ...)。

I succeeded in running google map in my app on the tablet(ASUS TF201). However, it can't work on my other Android mobile phones(Samsung, HTC...).

我用通过密钥工具生成的SHA1,对谷歌API控制台注册​​,并获得了调试的关键。导入库和设置权限一步一步来。

I use SHA1 generated by keytool, register on google api console, and get the debug key. Import lib and set permission step by step.

无论我运行控制台出现这样的:

Console appears this wherever I run it:

[2013-03-28 11:19:18 - google-play-services_lib] Could not find google-play-services_lib.apk!

出现的效果很好的平板电脑了。

Appear on the tablet which works well,too.

否则,如果它与下面的logcat:

Failure if it's with below logcat:

 03-28 11:10:56.382: E/Google Maps Android API(32067): Failed to load map.  Could not contact Google servers.
    03-28 11:03:54.165: E/Google Maps Android API(9610): Authorization failure.
    03-28 11:03:55.135: D/dalvikvm(9610): GC_CONCURRENT freed 286K, 13% free 10643K/12231K, paused 24ms+3ms, total 89ms
    03-28 11:03:55.580: E/Google Maps Android API(9610): Failed to load map.  Could not contact Google servers.
    03-28 11:03:55.595: E/Google Maps Android API(9610): Failed to load map.  Could not contact Google servers.
    03-28 11:03:56.085: E/Google Maps Android API(9610): Failed to load map.  Could not contact Google servers.
    ...

我找不到的哪些步骤我错过了。请给我一些建议,如果你知道。

I can't find which steps I missed. Please give me some suggestion if you knew.

推荐答案

我解决这个问题,我自己!

I solve this problem by myself!

在谷歌控制台> API接取> 编辑$允许Android应用程序...

SHA1密钥; Android应用程序包名

包名称必须设置结构的叶。例如, com.peter.example1 的作品,但 com.peter 是无效的。虽然我仍然不知道为什么它在平板电脑上使用错误的设置。

The packet name need to be set to the leaf of the structure. For example, com.peter.example1 works but com.peter is invalid. Though I still don't know why it works on the tablet with wrong setting.

 
精彩推荐
图片推荐