然而,另一个谷歌Android地图API v2身份验证问题 [英] Yet another Google Android Maps API v2 authentication issue
问题描述
我不得不为Android示例应用程序工作谷歌地图API第2版,完美的工作,直到我初始化一个Git仓库在它的目录中。
我从那时起擦除整个项目,在谷歌的云控制,它的所有引用,并开始了新的项目。
我现在面临的问题是一个身份验证问题:
10月11日至7日:44:05.445:E /谷歌地图的Android API(3640):确保下面对应的是在API控制台:包名称:[包名称],API密钥:[关键],证书指纹:[指纹]
我已经试过无济于事:
1.三重检查API密钥和正确
2.删除整个项目,禁止谷歌地图API第2版为Android,重新启用它并重新创建项目
3. MAPS_RECEIVE
添加权限
4.清洗,拆卸和重新安装发行包
这个人真的难倒...
这里是清单:
I had a working Google maps API v2 for Android example application that worked perfectly until I initialized a git repository in it's directory.
I have since then erased the entire project, all references to it in the Google cloud control, and started a new project.
The problem I'm facing now is an authentication issue:
11-07 10:44:05.445: E/Google Maps Android API(3640): Ensure that the following correspond to what is in the API Console: Package Name: [package name], API Key: [key], Certificate Fingerprint: [fingerprint]
I already tried with no avail:
1. Triple check API key and correct
2. Erase the entire project, disable Google maps API v2 for Android, enable it again and recreate the project
3. Add permissions for MAPS_RECEIVE
4. Cleaning, removing, and re-installing the release package
Really stumped by this one...
Here is the manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompany.mypackage"
android:versionCode="1"
android:versionName="1.0" >
<permission
android:name="com.mycompany.mypackage.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<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="com.mycompany.mypackage.permission.MAPS_RECEIVE" />
<!--
The following two permissions are not required to use
Google Maps Android API v2, but are recommended.
-->
<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" />
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="[My Key]" />
<activity
android:name="com.mycompany.canipark.MapExample"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
这里是code:
And here is the code:
package com.mycompany.mypackage;
import com.mycompany.mypackage.R;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class MapExample extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gmaps);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.gmaps, menu);
return true;
}
}
和布局:
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
map:mapType="normal" />
和谷歌的云控制台:
http://i.stack.imgur.com/hSx9N.jpg
http://i.stack.imgur.com/8sNbm.jpg
And the Google cloud console:
http://i.stack.imgur.com/hSx9N.jpg
http://i.stack.imgur.com/8sNbm.jpg
推荐答案
我真的不明白这个..
我等了两天,突然一切都再次合作。我没有改变code一行。
希望谷歌将增加其他有意义的错误比授权失败当它...
谢谢你们的帮助!
I really don't understand this..
I waited two days, and suddenly everything's working again. I didn't change a single line of code.
Wish Google will add a meaningful error other than Authorization failure when it does...
Thanks guys for your help!
这篇关于然而,另一个谷歌Android地图API v2身份验证问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!