• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Getting started application not working

ujur007

Lurker
Dec 1, 2021
3
0
Hi,

I am new to Android application development.

I was following the getting started tutorial onthe following link. After following all the step when I try to run the app, I get error in AndroidManifest.xml file. The file get edited every time the build is run in the android studio.

https://developer.android.com/training/basics/firstapp/starting-activity

here is the final .xml file. There error is at line 31

AAPT: error: unexpected element <intent-filter> found in <manifest><application>.

Can anyone tell me what is wrong happaning here?

Java:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myfirstapp"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="21"
        android:targetSdkVersion="31" />

    <application
        android:allowBackup="true"
        android:appComponentFactory="androidx.core.app.CoreComponentFactory"
        android:debuggable="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.MyFirstApp" >
        <activity
            android:name="com.example.myfirstapp.DisplayMessageActivity"
            android:parentActivityName="com.example.myfirstapp.MainActivity" >

            <!-- The meta-data tag is required if you support API level 15 and lower -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".MainActivity" />
        </activity>
            android:name=".MainActivity"
            android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

        <provider
            android:name="androidx.startup.InitializationProvider"
            android:authorities="com.example.myfirstapp.androidx-startup"
            android:exported="false" >
            <meta-data
                android:name="androidx.emoji2.text.EmojiCompatInitializer"
                android:value="androidx.startup" />
            <meta-data
                android:name="androidx.lifecycle.ProcessLifecycleInitializer"
                android:value="androidx.startup" />
        </provider>
    </application>

</manifest>
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones