2017-10-20 7 views
-1

Quel est le problème? je suis en utilisant studio Android 2.3 ** Erreur: Exception lors de l'analyse du fichier manifeste fourni C: \ Users \ hp \ AndroidStudioProjects \ Two_Screens \ app \ src \ main \ AndroidManifest.xmlLe type d'élément "application" doit être terminé par l'étiquette de fin correspondante "</ application>"

The element type "application" must be terminated by the matching end-tag "".**

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

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:roundIcon="@mipmap/ic_launcher_round" 
    android:supportsRtl="true" 
    android:theme="@style/AppTheme"> 
    <activity android:name="com.example.hp.two_screens.MainActivity"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <activity android:name="com.example.hp.two_screens.SecondActivity" /> 
    </activity> 
</application> 
+6

Le deuxième point d'ouverture de l'élément '' est auto-fermé. C'est-à-dire soit supprimer le '/' de la fin, soit supprimer le '' sur la ligne suivante. –

Répondre

3

La balise SecondActivity est déjà fermée (se termine par />), vous avez donc un fichier XML de manifeste de format incorrect en raison d'une balise </activity> supplémentaire. Supprimez cette étiquette pour résoudre le problème.

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:roundIcon="@mipmap/ic_launcher_round" 
    android:supportsRtl="true" 
    android:theme="@style/AppTheme"> 

    <activity android:name="com.example.hp.two_screens.MainActivity"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

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

    <activity android:name="com.example.hp.two_screens.SecondActivity" /> 

    //</activity> remove this closure!! 

</application> 
+0

Merci @Alex Ta – Auodumber