繁体   English   中英

Google Maps API密钥奇怪的错误

[英]Weird error with Google Maps API Key

当我运行具有Eclispe的Google地图的应用程序时,该地图将显示出来,并且所有地图功能都可以使用。

但是,如果我与朋友共享Eclipse项目或将我的应用程序导出为APK并重新安装到设备上,则地图不会显示。 它说:

02-07 00:26:39.644: E/Google Maps Android API(3605): Authorization failure.  Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.

我不确定是什么原因造成的。 特别是因为当我(谁从控制台获取APK并使用SHA1设置所有内容)从Eclipse运行时,它可以正常工作吗?

这是我的XML main.xml和地图片段

<android.support.v4.widget.DrawerLayout ...... >

<LinearLayout ... >
<RelativeLayout ..>
<Button ... > </Button>
<EditText .. > </EditText>

<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="20"
class="com.google.android.gms.maps.SupportMapFragment" />
</LinearLayout>

  <ListView android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
</android.support.v4.widget.DrawerLayout>

我怀疑您只有一把钥匙,用于调试版本。 您需要另一个发行版本。

编辑:由于存在一个已知的问题,只是重新上传(通过Eclipse)或更新可能不会更改清单所在的清单,因此请重新安装该应用程序。

我曾经遇到过类似的问题,您需要转到Google控制台 ,然后转到服务,然后打开Google Maps Android API v2

为了创建Build(apk)并允许Google Map在所有设备中可见,您必须使用Release Key创建Keystore。

检查此链接

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM