ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

java – Manifest Merger Failed – 访问google maps v2权限

2019-07-16 08:26:01  阅读:79  来源: 互联网

标签:java android google-maps manifest



您好,我正在通过android studio中的stackskills棒棒糖教程构建应用程序.我正在完全按照教程并收到此错误,我无法弄清楚这里有什么问题请看看我的清单我感谢您的帮助!

这里错了

Error:(24, 13) Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#com.google.android.gms.version@value value=(730) from AndroidManifest.xml:24:13
    is also present at com.google.android.gms:play-services-base:7.3.0:23:13 value=(@integer/google_play_services_version)
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:23:9 to override

这是我的表现

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.hailey.parse" >

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".SplashActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
        </activity>
        <meta-data android:name="com.google.android.gms.version"
            android:value="730"/>
        <meta-data android:name="com.google.android.maps.v2.API_KEY"
            android:value="I am ommiting the key here but it is in the code correctly"/>
    </application>

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true"/>
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <!-- 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"/>

</manifest>

解决方法:

根据this Google+ post,Google Play服务7.0及更高版本会自动为您包含< meta-data android:name =“com.google.android.gms.version”行 - 您可以将其全部保留在Manifest之外.



标签:java,android,google-maps,manifest

专注分享技术,共同学习,共同进步。

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有