How to solve “Failed to parse XML in AndroidManifest.xml
Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!
We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!
Learn from Guru Rajesh Kumar and double your salary in just one year.
Error:
Caused by: com.android.builder.errors.EvalIssueException: Failed to parse XML in C:\Users\dharm\AndroidStudioProjects\mhn_app_doctor\android\app\src\main\AndroidManifest.xml The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.
AndroidManifest.xml
App module
Dependencies
Solution:
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
Go to the project folder, in app ->> src ->> main and modify the AndroidManifest.xml with notepad.
You need to put the -uses permission- between
<?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.exemple">
Your manifest should be of this format:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<application
android:hardwareAccelerated="true">
...
</application>
</manifest>