Ошибка в манифесте Android

У меня возникла проблема при попытке подписать приложение для распространения в Google Play. Вот ошибка:

Error:(22) Error: The <receiver> element must be a direct child of the <application> element [WrongManifestParent]

И манифест:

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

    <!-- Permisos -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

    <!-- Optional permission for reliable local dispatching on non-Google Play devices -->
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <!-- Add the following meta-data for devices running Google Play service. -->
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <!--
         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
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">
        <activity
            android:name=".ViveUnaExperiencia"
            android:label="@string/title_activity_main">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

    </application>

</manifest>

Я не уверен, что вызывает это. Любая помощь приветствуется.

 Vucko08 июл. 2016 г., 09:59
Я думаю, что ошибка довольно наглядна, она говорит точно, что не разрешено и что должно быть :)
 SripadRaj08 июл. 2016 г., 09:51
поместите получатель и метки обслуживания в тег приложения
 Vivek Mishra08 июл. 2016 г., 09:51
тег приемника должен быть внутри тега приложения
 comrade08 июл. 2016 г., 09:52
Описание ошибки содержит всю необходимую информацию :). Просто поместите ваш приемник, служебные теги в тег приложения.

Ответы на вопрос(2)

манифест структура файла ......

использовать этот

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

        <!-- Permisos -->
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

        <!-- Optional permission for reliable local dispatching on non-Google Play devices -->
        <uses-permission android:name="android.permission.WAKE_LOCK" />



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

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


  <!-- Add the following meta-data for devices running Google Play service. -->
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <!--
             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>

наслаждайся кодированием ............

это должно работать:

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

<!-- Permisos -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

<!-- Optional permission for reliable local dispatching on non-Google Play devices -->
<uses-permission android:name="android.permission.WAKE_LOCK"/>

<!-- Add the following meta-data for devices running Google Play service. -->
<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version"/>

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

            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
    <service
        android:name="com.google.android.gms.analytics.AnalyticsService"
        android:enabled="true"
        android:exported="false"/>

    <service android:name="com.google.android.gms.analytics.CampaignTrackingService"/>

    <!--
     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>

    <!--
             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>
</application>

Ваш ответ на вопрос