Reputation: 40444
I'm trying to add an application to my manifest but I receive and error: attribute Android: name is not allowed here
<?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>
Upvotes: 2
Views: 7877
Reputation: 7499
add android:name attribute to the existing application tag in the manifest file
android:name="com.test.app.connection.AppController"
Upvotes: 0
Reputation: 1713
http://developer.android.com/guide/topics/manifest/manifest-intro.html
you can only have one Application Tag for your Application as demonstrated above,try to use android documentation as much as you can! Best!
Upvotes: 1
Reputation: 132972
attribute Android: name is not allowed here
Because you are trying to add application
tag inside application
tag which is not allowed in AndroidManifest.xml
Only single application
tag is allowed which will contains other application components like Activities, Services, BroadcastReceiver,...
So remove second application
tag and add all attribute like name
,icon
,... in single application
:
<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>
Upvotes: 1