简体   繁体   English

该 <uses-permission> 元素必须是直接的孩子 <manifest> 根元素

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

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 "". 我正在尝试运行我的Android应用程序,但我收到以下错误元素必须是根元素的直接子元素,元素类型“application”必须由匹配的结束标记“”终止。 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>

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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2019 Android - 意外元素<uses-permission>在发现<manifest><application></application></manifest></uses-permission> - Visual studio 2019 Android - unexpected element <uses-permission> found in <manifest><application> 这<activity>元素必须是<application>库清单中的元素 - The <activity> element must be a direct child of the <application> element In Library Manifest 表现出多个问题,活动元素必须是直接子元素 - manifest multiple problems the activity element must be a direct child 的角色 <uses-permission> 清单文件中标记? - Role of <uses-permission> tag in manifest file? <uses-permission> 与 <permission> 在Android 6.0中的Manifest.xml - <uses-permission> vs <permission> in Android 6.0 Manifest.xml 该 <activity> 元素必须是的直接子元素 <application> 元件 - The <activity> element must be a direct child of the <application> element 这<receiver>元素必须是<application>元素 - The <receiver> element must be a direct child of the <application> element 找不到清单文件中的使用权限 - Can't find uses-permission into manifest file Android Studio 忽略清单使用权限条目 - Android Studio ignoring Manifest uses-permission entries Android 23不生成用户权限元素的清单文件 - Android 23 Not Generating Manifest file for uses-permission elements
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM