2016-04-07 7 views
2

私が言及したように、私は の最初の1つがGoogle GeoLoaction Apiであり、2番目のものがAutoComplete Apiであり、私のプロジェクトで2つの異なるGoogle APIを使用しようとしていました。 問題は、アプリケーションメタデータのManifest.xmlにキーが必要ですが、両方を追加しようとすると、2番目のキーが最初のキーを上書きします。 1つのAndroidプロジェクトで2種類のGoogle APIを使用するにはどうすればよいですか?

私は私の値に別の文字列を追加することも試み
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:supportsRtl="true" 
    android:theme="@style/AppTheme"> 
    <activity android:name=".MapsActivity"> 
     <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.geo.API_KEY" 
     android:value="@string/google_maps_key" /> 

</application> 

<?xml version="1.0" encoding="utf-8"?> 

、それは同様に動作しませんでした。

答えて

1

​​3210とGeoLocationのAPIは、同じAPI Key.Youで使用することができ、あなたのManifest。あなたに一度だけのキーを追加する必要があるだけでGoogle Developer Consoleに必要なAPIを有効にする必要があります。

関連する問題