gpt4 book ai didi

android - 谷歌授权

转载 作者:行者123 更新时间:2023-11-29 01:56:39 25 4
gpt4 key购买 nike

我是基于谷歌地图的应用程序的新手,正在尝试使用它。我使用了 mainfest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.abhishekbietcs.locomap"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<permission
android:name="com.abhishekbietcs.locomap.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.abhishekbietcs.locomap.permission.MAPS_RECEIVE"/>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />


<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.abhishekbietcs.locomap.Mapme"
android:label="@string/title_activity_mapme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my key" />
</application>

我从这段代码中得到了我的调试证书 sh1 fngrprint

keytool.exe -list -alias androiddebugkey -keystore ".....\.android\debug.keystore" -storepass android -keypass android -v

这是我的xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Mapme" >
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"/>

现在当我在我的手机上安装时,log cat 中出现 google 授权失败。请帮助我找出我做错的地方,在此先感谢

最佳答案

在创建使用 Google Maps API 的应用程序之前,您必须执行几个步骤:

  • 在 Google API 控制台中创建 Google API 项目( https://code.google.com/apis/console )
  • 为 Android 启用 Google Maps API(在“服务”标签中)
  • 创建新的客户端 ID(您应该输入 SHA1 key 和您的应用程序包名称)

你都做到了吗?如果是,请提供logcat输出,其中包含有关授权失败的信息。

关于android - 谷歌授权,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14789458/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com