1. Are you ready for the Galaxy S20? Here is everything we know so far!

Getting started application not working

Discussion in 'Android Development' started by ujur007, Dec 1, 2021.

  1. ujur007

    ujur007 Lurker
    Thread Starter

    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?

    Code (Java):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    3.     package="com.example.myfirstapp"
    4.     android:versionCode="1"
    5.     android:versionName="1.0" >
    6.  
    7.     <uses-sdk
    8.         android:minSdkVersion="21"
    9.         android:targetSdkVersion="31" />
    10.  
    11.     <application
    12.         android:allowBackup="true"
    13.         android:appComponentFactory="androidx.core.app.CoreComponentFactory"
    14.         android:debuggable="true"
    15.         android:icon="@mipmap/ic_launcher"
    16.         android:label="@string/app_name"
    17.         android:roundIcon="@mipmap/ic_launcher_round"
    18.         android:supportsRtl="true"
    19.         android:theme="@style/Theme.MyFirstApp" >
    20.         <activity
    21.             android:name="com.example.myfirstapp.DisplayMessageActivity"
    22.             android:parentActivityName="com.example.myfirstapp.MainActivity" >
    23.  
    24.             <!-- The meta-data tag is required if you support API level 15 and lower -->
    25.             <meta-data
    26.                 android:name="android.support.PARENT_ACTIVITY"
    27.                 android:value=".MainActivity" />
    28.         </activity>
    29.             android:name=".MainActivity"
    30.             android:exported="true">
    31.         <intent-filter>
    32.             <action android:name="android.intent.action.MAIN" />
    33.  
    34.             <category android:name="android.intent.category.LAUNCHER" />
    35.         </intent-filter>
    36.  
    37.         <provider
    38.             android:name="androidx.startup.InitializationProvider"
    39.             android:authorities="com.example.myfirstapp.androidx-startup"
    40.             android:exported="false" >
    41.             <meta-data
    42.                 android:name="androidx.emoji2.text.EmojiCompatInitializer"
    43.                 android:value="androidx.startup" />
    44.             <meta-data
    45.                 android:name="androidx.lifecycle.ProcessLifecycleInitializer"
    46.                 android:value="androidx.startup" />
    47.         </provider>
    48.     </application>
    49.  
    50. </manifest>
     



    1. Download the Forums for Android™ app!


      Download

       
  2. Unforgiven

    Unforgiven ...eschew obfuscation...
    Moderator

    Welcome to AF. I moved this to the development area for better exposure. Good luck!! :)
     
    mikedt likes this.
Loading...

Share This Page

Loading...