0

アプリでマップビューを使用しようとしているので、手順を1つずつ実行しました。しかし、私は灰色のグリッドしか持っていません。API キーを 4 回生成しましたが、毎回同じ結果が得られます。

手伝っていただけませんか?

これらは私が得たエラーです:

failed to find provider info for com.google.settings
couldn't get connection factory client

私のマニフェストファイル

   <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.me.test.g_maps"
    android:versionCode="1"
    android:versionName="1.0" >

        <uses-sdk
        android:minSdkVersion="7"
        android:targetSdkVersion="17" />

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

        <permission
        android:name="com.me.test.g_maps.permission.MAPS_RECEIVE"
        android:protectionLevel="signature"/>

        <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
            <activity
            android:name="com.me.test.g_maps.MainActivity"
            android:label="@string/app_name" >
                <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="AIzaSyCEgLQ7HgXiKTP8grZRmpIPAeWoSfAjrBM"/>

            <uses-library android:name="com.google.android.maps" />

        </application>

        </manifest> 

私の活動

    package com.me.test.g_maps;

    import android.os.Bundle;

   import com.google.android.maps.MapActivity;

    public class MainActivity extends MapActivity {

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
        }

        @Override
        protected boolean isRouteDisplayed() {
            // TODO Auto-generated method stub
            return false;
        }

    }

私のxml

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent">

        <com.google.android.maps.MapView 
            android:id="@+id/mapView"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:enabled="true"
            android:clickable="true"
            android:apiKey="AIzaSyCEgLQ7HgXiKTP8grZRmpIPAeWoSfAjrBM"
            />

    </RelativeLayout>
4

3 に答える 3

1

見た目には問題はほとんどありません (Google Map API V2 テクノロジをターゲットにしている場合)

1.まず、この権限を削除します。

<uses-library android:name="com.google.android.maps" />

これは Google Maps API V1 の一部であり、Google Maps API V2 では必要ありません。

2. Google Maps API V2 には OpenGL-v2 のサポートが必要なため、マニフェスト ファイルに次を追加する必要があります。

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

3. Google API コンソールで正しい API をオンにしていることを確認します。 ここに画像の説明を入力

4.debug.keystoreを削除し、プロジェクトをコンパイルして、キーの再生成を試みます。これにより、新しいSHA1署名が作成されます。

5. エミュレーターでアプリケーションを実行する場合は、エミュレーターで Google Map API V2 を有効にする方法について書いた次のブログ記事を確認してください。

エミュレータの Google Map API V2

于 2013-04-04T11:11:57.990 に答える
0

Google api V1 を使用している場合は、署名せずにアプリをデバッグするときに、マップを正しく読み込むためにデバッグ キーを作成する必要があります。
それ以外の場合は、こちらをご覧ください。Google Maps API V2 を使用するには、マニフェストの新しい構成が必要です。

于 2013-04-04T10:33:15.913 に答える