The <uses-permission> element must be a direct child of the <manifest> root element

android, manifest, xml

Solution

here you go

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

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />

    <!-- Allow to connect with internet and to know the current network state -->
    <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.daytraders.Login"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <activity
            android:name="Profile"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name="Main"
            android:label="Day Traders USER PANEL" >
        </activity>
    </application>


</manifest>

Problem

I'm trying to run my android app but I'm getting the following error The element must be a direct child of the root element and The element type "application" must be terminated by the matching end-tag "". Can somebody write me the 'correct' version of it? Thanks. This is my manifest file ``` <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.daytraders" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.example.daytraders.Login" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </activity> <activity android:label="@string/app_name" android:name="Profile"> </activity> <activity android:label="Day Traders USER PANEL" android:name="Main"> </activity> </application> <!-- Allow to connect with internet and to know the current network state--> <uses-permission android:name="android.permission.INTERNET"> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"> </uses-permission></uses-permission></manifest> ```

Original source