android studio中的清单错误

时间:2018-01-04 10:35:08

标签: android gradle android-manifest manifest

我收到此错误

  

错误:任务':app:processDebugManifest'的执行失败。表现   合并失败并出现多个错误,请参阅日志

我该怎么做才能删除此错误?

我的android清单文件是:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.app.jmbnewsonline"
    android:installLocation="auto">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
    <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT" />


    <application
        android:name=".app.AppController"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        android:largeHeap="true"
        android:supportsRtl="true">

        <!-- Google Play Store Services -->
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <!-- Google Analytics Version v4 needs this value for easy tracking -->
        <meta-data android:name="com.google.android.gms.analytics.globalConfigResource"
            android:resource="@xml/global_tracker" />

        <activity
            android:name=".activities.SplashActivity"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <!-- Main Activity -->
        <activity
            android:name=".activities.MainActivity"
            android:configChanges="orientation|keyboardHidden|screenSize" >

        </activity>

        <!-- Contact Activity -->
        <activity
            android:name=".activities.ContactActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:parentActivityName=".activities.MainActivity"
            android:screenOrientation="portrait"
            android:launchMode="singleTop">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activities.MainActivity" />
        </activity>

        <!-- Page View Activity -->
        <activity
            android:name=".activities.PagesActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:parentActivityName=".activities.MainActivity"
            android:hardwareAccelerated="true"
            android:launchMode="singleTop">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activities.MainActivity" />
        </activity>

        <!-- Post View Activity -->
        <activity
            android:name=".activities.PostViewActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:parentActivityName=".activities.MainActivity"
            android:hardwareAccelerated="true"
            android:launchMode="singleTop">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activities.MainActivity" />
            <intent-filter>
                <action android:name="POSTVIEW" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <!-- Image View Activity -->
        <activity
            android:name=".activities.ImageViewActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:parentActivityName=".activities.PostViewActivity"
            android:hardwareAccelerated="true"
            android:launchMode="singleTop">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activities.PostViewActivity" />
        </activity>

        <!-- Image View Activity -->
        <activity
            android:name=".activities.ExternalPageActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:parentActivityName=".activities.PostViewActivity"
            android:hardwareAccelerated="true"
            android:launchMode="singleTop">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activities.PostViewActivity" />
        </activity>

        <!-- Post View Activity -->
        <activity
            android:name=".activities.PostComments"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:parentActivityName=".activities.PostViewActivity"
            android:launchMode="singleTop">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activities.PostViewActivity" />
        </activity>

        <!-- Setting Activity -->
        <activity
            android:name=".activities.SettingsActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:screenOrientation="portrait" >

            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activities.MainActivity" />
        </activity>

        <!-- About Activity -->
        <activity
            android:name=".activities.AboutActivity"
            android:parentActivityName=".activities.SettingsActivity" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activities.SettingsActivity" />
        </activity>

        <!-- DeepLink Activity -->
        <activity
            android:name=".activities.DeepLinkParser"
            android:theme="@android:style/Theme.NoDisplay">
            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>

                <!-- Handles any blogpress://deeplink URI's -->
                <data
                    android:host="@string/deep_link_host"
                    android:scheme="@string/deep_link_scheme"/>

                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>
            </intent-filter>
        </activity>


        <!-- Include the AdActivity configChanges and theme. -->
        <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent" />

        <!-- Include the Firebase Service in App. -->
        <service
            android:name="com.app.jmbnewsonline.Services.FirebaseInstanceIDService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT"/>
            </intent-filter>
        </service>
        <service
            android:name="com.app.jmbnewsonline.Services.FirebaseInstanceIDService">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
            </intent-filter>
        </service>


        <!-- Optionally, register AnalyticsReceiver and AnalyticsService to support background
                 dispatching on non-Google Play devices -->
        <receiver android:name="com.google.android.gms.analytics.AnalyticsReceiver"
            android:enabled="true">
            <intent-filter>
                <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
            </intent-filter>
        </receiver>
        <service android:name="com.google.android.gms.analytics.AnalyticsService"
            android:enabled="true"
            android:exported="false"/>

        <!-- Optionally, register CampaignTrackingReceiver and CampaignTrackingService to enable
             installation campaign reporting -->
        <receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
            android:exported="true">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>
        <service android:name="com.google.android.gms.analytics.CampaignTrackingService" />
    </application>

</manifest>

2 个答案:

答案 0 :(得分:0)

在正在构建的Android Studio中,清理构建项目。

答案 1 :(得分:0)

您宣布两次FirebaseInstanceIDService。试试这个。

<service android:name="com.app.jmbnewsonline.Services.FirebaseInstanceIDService">
    <intent-filter>
      <action android:name="com.google.firebase.MESSAGING_EVENT"/>
      <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
    </intent-filter>
</service>