Haroun SMIDA Haroun SMIDA - 3 months ago 23
Android Question

Tag <manifest> attribute package has invalid character ' ' Android Manifest

I am getting the error "Tag attribute package has invalid character ' '." in the Android Manifest, while there is no obviously invalid character. Here is the code:

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

<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="22" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
android:name="com.example.harounsmida.test2.app.AppController"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.harounsmida.test2.LoginActivity"
android:label="@string/app_name"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.harounsmida.test2.RegisterActivity"
android:label="@string/app_name"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" />
<activity
android:name="com.example.harounsmida.test2.MainActivity"
android:label="@string/app_name"
android:launchMode="singleTop" />
<activity
android:name="com.example.harounsmida.test2.UploadToServerActivity"
android:label="@string/app_name"
android:launchMode="singleTop" />
</application>

</manifest>


I don't understand where is the problem, Android Studio says that "File under the build folder are generated and should not be edited." although I didn't edit it.

Answer

Remove space from package name :

package="com.exampl e.harounsmida.test2"

After removing space :

package="com.example.harounsmida.test2"