What does Error:(13) Error: The <receiver> element must be a direct child of the <application> element [WrongManifestParent] mean and how do i fix it?

What does Error:(13) Error: The <receiver> element must be a direct child of the <application> element [WrongManifestParent] mean and how do i fix it?

我在尝试编译我的应用程序时遇到问题,我试图从拨号程序启动它,但清单文件出现此错误。这是我的清单文件

<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <receiver
            android:name=".receiver.DialReceiver"
            android:exported="true"

            android:process=":background"
            >
            <intent-filter>
                <action android:name="android.intent.action.NEW_OUTGOING_CALL" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </receiver>
    </activity>
</application>

移动

 <receiver
        android:name=".receiver.DialReceiver"
        android:exported="true"

        android:process=":background"
        >
        <intent-filter>
            <action android:name="android.intent.action.NEW_OUTGOING_CALL" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </receiver>

<activity> 标签外

尝试像这样修改您的清单:

<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
    </activity>
    <receiver
        android:name=".receiver.DialReceiver"
        android:exported="true"
        android:process=":background">
        <intent-filter>
            <action android:name="android.intent.action.NEW_OUTGOING_CALL" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </receiver>
</application>