此处不允许将应用程序添加到manifest:attribute Android:name

此处不允许将应用程序添加到manifest:attribute Android:name,android,Android,我正在尝试将应用程序添加到清单中,但我收到一个错误:属性Android:name在此不允许 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.test.app" > <uses-permission android:name="android.

我正在尝试将应用程序添加到清单中,但我收到一个错误:
属性Android:name在此不允许

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

        <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:screenOrientation="portrait"
            android:name="com.test.app.activity.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <meta-data android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

    </application>

    <application
        android:name="com.test.app.connection.AppController" <--- problem
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <!-- all activities and other stuff -->
    </application>

</manifest>

属性:此处不允许使用名称

因为您正试图在
application
标记内添加
application
标记,而
AndroidManifest.xml

只允许使用单个
应用程序
标记,该标记将包含其他应用程序组件,如活动、服务、广播接收器等

因此,删除第二个
应用程序
标记,并添加所有属性,如
名称
图标
,。。。在单个
应用程序中

 <application
        android:name="com.test.app.connection.AppController"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
     <!-- add application components here -->
</application>


如上所示,您的应用程序只能有一个应用程序标记,请尽可能多地使用android文档!最好的

将android:name属性添加到清单文件中的现有应用程序标记中

android:name="com.test.app.connection.AppController"

在应用程序中只能使用单个应用程序标记manifest@Karl莫里森,我和你有类似的问题。当我将项目从Eclipse导入IntelliJ时,问题就出现了。(好吧,这对我来说是一个非常疯狂的问题,因为当我将项目从Eclipse/Android Studio导入IntelliJ时,会出现很多奇怪的问题,尽管它们具有相同的设置)而且,我只有一个应用程序,并且所有标记都设置正确。你把它修好了吗?也许我需要你的帮助!提前谢谢。