Search code examples
androidandroid-activityandroid-manifest

XML tag has empty body, no default activity


I am new to working with XML and editing the layout in my Android application, and it gives me the error "XML has an empty body." Can someone tell me what I did wrong? This is my code:

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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.CALL_PHONE" />

    <application
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"

        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:ignore="GoogleAppIndexingWarning">
        <activity
            android:name=".DailerActivity"></activity>
        <activity
            android:name=".RecordListActivity"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <receiver
            android:name=".PhoneStateListener"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.PHONE_STATE" />
            </intent-filter>
        </receiver>

        <service
            android:name=".MediaRecorderService"
            android:enabled="true"
            android:exported="true" />

        <meta-data
            android:name="io.fabric.ApiKey"
            android:value="2944b4c7d4c11d8f9bad64de95d00ffecb271de0" />
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="@string/app_id" />
        <meta-data
            android:name="com.google.android.gms.ads.AD_MANAGER_APP"
            android:value="true" />
    </application>

</manifest>

I am new to working with XML and editing the layout in my Android application, and it gives me the error "XML has an empty body." Can someone tell me what I did wrong? This is my code:


Solution

  • DailerActivity has empty XML body like <activity> </activity>

    Replace

    <activity android:name=".DailerActivity"></activity>
    

    to

    <activity android:name=".DailerActivity"/>