'Missing 'name' key attribute on element activity as AndroidManifest.xml

I encounter the following error when running gradle build:

Missing 'name' key attribute on element activity at AndroidManifest.xml

Looking up the other stackoverflow questions, I commented out the "intent-filter" parts, but the error still remains. Current AndroidManifest.xml:

<manifest xmlns:android="https://schemas.android.com/apk/res/android"
    package="com.example.MyProject"
    android:versionCode="1"
    android:versionName="1.0" >
    
    <uses-sdk
        android:misSdkVersion="24"
        android:targetSdkVersion="28" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
        </activity>
    </application>

</manifest>

Any suggestions? Thanks in advance



Solution 1:[1]

use http in xmlns:android

    "http://schemas.android.com/apk/res/android"
    <manifest 
        xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.MyProject"
        android:versionCode="1"
        android:versionName="1.0" >
        <uses-sdk
            android:misSdkVersion="24"
            android:targetSdkVersion="28" />
    
        <application
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme" >
            <activity
                android:name=".MainActivity"
                android:label="@string/title_activity_main" >
            </activity>
        </application>
    
    </manifest>

Solution 2:[2]

Specificy a name attribute on the Application tag of your Android manifest file:

<application
     // Declare a name tag here:
         android:name=""
         android:icon="@drawable/ic_launcher"
         android:label="@string/app_name"
         android:theme="@style/AppTheme" >

         <activity
              android:name=".MainActivity"
              android:label="@string/title_activity_main" >
         </activity>
</application>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 MHSFisher