0

I have coded an application .Everything is fine in the code. But it do not run in the emulator. It give some error as follows:

  1. Parser exception for D:\Android Workspace\DbTuts\AndroidManifest.xml: The element type "application" must be terminated by the matching end-tag "".

  2. No command output when running: 'am start -n com.android.tuts/com.android.tuts.MyActivity -a android.intent.action.MAIN -c android.intent.category.LAUNCHER' on device emulator-5556

Manifest code is as follows :

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.android.tuts"
  android:versionCode="1"
  android:versionName="1.0">
 <uses-sdk android:minSdkVersion="8" />
 <application android:name=".ApplicationContextProvider"
         android:label="@string/app_name"></application> 

 <application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".MyActivity"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

  </application>
  </manifest>
TUSWAY
  • 27
  • 4

1 Answers1

1

Try using:

<?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.android.tuts"
  android:versionCode="1"
  android:versionName="1.0">
 <uses-sdk android:minSdkVersion="8" />

 <application android:name=".ApplicationContextProvider" android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".MyActivity"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

  </application>
  </manifest>

You were using two separate <application> elements before, which isn't allowed.

A--C
  • 36,351
  • 10
  • 106
  • 92
Raghav Sood
  • 81,899
  • 22
  • 187
  • 195