2017-11-03 11 views
0

私のアプリケーションでは、私はmanifestにメタデータを含めたので、1つ以上のサービスを使用しています。しかし、私の問題は、1つだけのメタタグを使用するとうまくいきますが、複数のタグを持つとエラーが発生します。誰もがどのようにマニフェストに複数のメタタグをしてください持っているために私を助けることができるマニフェストファイルに複数のメタデータがある場合

Error:Execution failed for task ':app:processDebugManifest'. 
> Manifest merger failed with multiple errors, see logs 

:ここ
は私たManifest.xml

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="place.picker.mymarket"> 
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 
<uses-permission android:name="android.permission.INTERNET" /> 
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" 
android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> 
    <activity android:name=".oneTimeValidation"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <activity android:name=".MainActivity" /> 
    <activity android:name=".MapsActivity"/> 
    <activity android:name=".list_my_posts" android:label="deletion list" /> 
    <activity android:name=".Upload_to_server"></activity> 
    <meta-data android:name="com.google.android.geo.API_KEY" 
    android:value="@string/google_place_api" /> 
    <meta-data 
    android:name="com.google.android.geo.API_KEY1" 
    android:value="@string/google_maps_key" /> 
</application> 
</manifest> 

であることはエラーをスローします。

+0

oneTimeValidationはあなたの開始アクティビティですか? – Anonymous

+0

[APIと同じAPIキーを使用してMapsとPlace APIを使用できますか?](https://stackoverflow.com/questions/37023930/is-it-possible-to-use-maps-and-place-api- with-same-api-key) –

+0

@Anonymousはい。 –

答えて

1

マニフェストで両方のキーを同時に宣言することはできません。 GoogleマップとGoogleプレイスを使用している場合は、GoogleプレイスAPIキー(com.google.android.geo.API_KEY)のみを使用してください。両方とも機能します。

+0

その正常に動作します。 –

2

開き、マニフェストと右の列で

enter image description here

合併マニフェスト

をクリックすると、エラー、次のメッセージのようなものについての詳細を見つけることができます。

enter image description here

2

ちょうどそれのための一つのキーを使用して、私はそれはあなただけのものを必要なときにそれらの両方を宣言するのは良いアイデアだとは思わないが、あなたはまだそれをしたい万が一ます。 1つのキーが両方のサービスで動作します。

<meta-data 
    android:name="com.google.android.maps.v2.API_KEY" 
    android:value="@string/google_places_api_key" />  

<meta-data 
    android:name="com.google.android.geo.API_KEY" 
    android:value="@string/google_places_api_key" /> 

希望します。

関連する問題