This is my android.manifest file. I searched a lot of things here but my problem is not solved yet. What can I do?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.e_healthcareapp" >
<application
android:allowBackup="true"
android:dataExtractionRules="#xml/data_extraction_rules"
android:fullBackupContent="#xml/backup_rules"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.EHealthcareApp"
tools:targetApi="31" >
<activity
android:name=".MainActivity"
android:exported="false"
android:label="#string/title_activity_register_option" />
<activity
android:name=".Login_options"
android:exported="false"
android:parentActivityName=".MainActivity" />
<activity
android:name=".Registration"
android:exported="false"
android:label="Registration Form"
android:parentActivityName=".Registration" />
<activity
android:name=".MainActivity2"
android:exported="false"
android:label="Log in Form"
android:parentActivityName=".MainActivity2" /> <!-- back button values -->
<activity
android:name=".MainActivity"
android:exported="true"
tools:ignore="DuplicateActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
this is my build.gradle(module:appname)
In your Manifest, you can choose between Text and Merged Manifest (in Android Studio below your Manifest).
Click on Merged Manifest and there is a detailed description of your error.
Something happend to my manifest.xml. I don't know what it is. I'm soon to be crazy about this. I uppgraded kotlin and gradle version, than I got a bunch of problems.
I have been looking at the manifest and I can' find an error. I have been looking att all the quesion and answers here at Stack Overflow too. I'm also new to android.
The framework I'm using is Flutter.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.digital.abcde">
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="32" />
<uses-permission android:name="android.permission.INTERNET"/>
<!-- ADD THESE TWO PERMISSIONS -->
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<application
android:label="abcde"
android:icon="#mipmap/ic_launcher"
android:fullBackupContent="true"
android:allowBackup="true">
<activity
android:name="com.ryanheise.audioservice.AudioServiceActivity"
android:exported="true"
tools:ignore="Instantiatable"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|
smallestScreenSize|locale|layoutDirection
|fontScale|screenLayout|density|uiMode"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- ADD THIS "SERVICE" element -->
<service android:name="com.ryanheise.audioservice.AudioService"
android:exported="false" tools:ignore="Instantiatable"
android:screenOrientation="portrait"android:allowBackup="true">
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService" />
</intent-filter>
</service>
<receiver android:name="com.ryanheise.audioservice.MediaButtonReceiver"
android:exported="true"
tools:ignore="Instantiatable">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
The error message I get is:
Error parsing LocalFile: 'C:\pro\projects\krimofonen\android\app\src\main\AndroidManifest.xml' Please ensure that the android manifest is a valid XML document and try again.
For some reason the xml header is missing. Did you just forget pasting it here? If it's really missing, add this to the beginning of your manifest file.
<?xml version="1.0" encoding="utf-8"?>
The start of your AndroidManifest.xml contains whitespace:
<?xml version="1.0" encoding="utf-8"?>
Make sure that the < is the very first character in the file and that should fix the error.
i don't know why this error arises suddenly it came in my stackrace
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(25.3.1) from [com.android.support:design:25.3.1] AndroidManifest.xml:27:9-31
is also present at [com.android.support:recyclerview-v7:26.0.0-alpha1] AndroidManifest.xml:24:9-38 value=(26.0.0-alpha1).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-27:34 to override.
Manifest file:
this is my manifest file, i had updated my android studio 2.3.2 recently.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.shopkart.theinvincible.shopkart">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
There is a version conflict in with the support library you used and the support version defined in your merged manifest file. You should add <meta-data> tag in your manifest file as shown below in order to override the conflict.(This is clearly mentioned in suggestion along with error log, see it)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.shopkart.theinvincible.shopkart">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<meta-data tools:replace="android:value"/>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
the Manifests have different SDK Versions and cannot be merged
you needed to edit Manifests.this may help you
use this below code or go back to the older version to continue your project.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.shopkart.theinvincible.shopkart">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<meta-data tools:replace="android:value"/>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I am following the guide to set up a serial Bluetooth application from TutorialsPoint.
However, I was prompted an error from Android Studio and I am a newbie.
Errors are :
Error:Attribute "name" bound to namespace "http://schemas.android.com/apk/res/android" was already specified for element "activity".
Error:Cannot read packageName from /Users/ooiquanzee/AndroidStudioProjects/ECG/app/src/main/AndroidManifest.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ooiquanzee.ecg">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity"
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:qzname="android.intent.action.MAIN" />
<category android:qzname="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
You have defined .MainActivity twice remove one from them.
And also you have defined action and category name as qzname
please update it as follow:
<activity android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
I have got Eclipse to generate a Basic android Hello World app, But it has 2 errors: first, in my AndroidManifest.xml on these two lines:
I get The markup in the document following the root element must be well formed, Also My R.java Will not generate, no matter how many times I clean my project. Any Answers?
the manifest is here: http://jsfiddle.net/NHDU6/
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
<!--
Declare the contents of this Android application. The namespace
attribute brings in the Android platform namespace, and the package
supplies a unique name for the application. When writing your
own application, the package name must be changed from "com.example.*"
to come from a domain that you own or have control over.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin" >
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<application
android:icon="#drawable/ic_launcher_home"
android:label="#string/home_title" >
<activity
android:name="Home"
android:launchMode="singleInstance"
android:stateNotNeeded="true"
android:theme="#style/Theme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="Wallpaper"
android:icon="#drawable/bg_android_icon"
android:label="Wallpaper" >
<intent-filter>
<action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Thanks, Jonathan
Here is your manifest,
You should not specify more than one Manifest and You should not specify more than one <application> tags.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<application
android:icon="#drawable/ic_launcher"
android:label="h" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="Home"
android:launchMode="singleInstance"
android:stateNotNeeded="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="Wallpaper"
android:icon="#drawable/ic_launcher"
android:label="Wallpaper" >
<intent-filter>
<action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
It may be that you are missing something, but sometimes doing a simple re-format of code: CTRL+SHIFT+F, clears the problem.
I looked at your manifest file. The error is caused because you have 2 declarations of <manifest /> tag.
It begins with:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin"
android:versionCode="1"
android:versionName="1.0" >
Then some comments follow and another declaration starts:
<!--
Declare the contents of this Android application. The namespace
attribute brings in the Android platform namespace, and the package
supplies a unique name for the application. When writing your
own application, the package name must be changed from "com.example.*"
to come from a domain that you own or have control over.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin" >
<uses-permission android:name="android.permission.CALL_PHONE" />
Your either forgot to comment one of the manifests tag, confused something, or following a wrong tutorial. The AndroidManifest file should have only one <manifest /> tag
The Auto-generated AndroidManifest.xml file has some problem by itself. There is two manifest tag and two uses-sdk tag inside it. That is the problem. Do as follows:
1- Delete the closing tag of first manifest tag which is:
</manifest>
2- Delete definition tag of the second manifest tag which is:
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="net.learn2develop.fragments"
android:versionCode="1"
android:versionName="1.0" >
3- If there is two uses-sdk tag, also delete the second uses-sdk tag.
I added a new activity to my app, and it gave this error after. The manifest disappeared from android-studio completely.
I had to edit the manifest with a text editor. It seems that when I added a new activity, Android Studio created a new tag then added the new activity tag inside in the manifest file, rather than just adding the tag with the new activity in the manifest.
After you update the manifest, the project worked fine.
<?xml version="1.0" encoding="utf-8"?>
< xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.groofy">
<activity
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"/>
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:theme="#style/AppTheme.NoActionBar"/>
<activity
android:name=".SignUp"
android:label="#string/title_activity_sign_up"
android:theme="#style/AppTheme.NoActionBar"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
/> should not be at the end of the file I had the same issue the error means the xml file is not correctly formatted you should try removing the / in front of the > or simply reformat