0
我試圖讓應用程序簽署分發到Google Play時出現問題。以下是錯誤:Android清單上的錯誤
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>
我不知道是什麼導致了這一點。任何幫助表示讚賞。
接收器標籤應該是內部應用程序標籤 –
把接收器和服務標籤內的應用程序標籤 – SripadRaj
錯誤描述包含所有必要信息:)。只需將您的接收器,服務標籤放在應用程序標籤上 – comrade