0

ParseError at [row,col]:[2,6] Message: The processing instruction target matching "[xX][mM][lL]" is not allowed. I keep receiving this error,

I believe it is an issue in my Manifest file but i'm unsure how to fix it, any help is appreciated.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.assignment1_20240007">
    <application
        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/Theme.Assignment1_20240007">
        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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



    </application>

</manifest>
nath
  • 1
  • 1

2 Answers2

0

It might be something related to your Gradle configuration. Instructions that use those "matching" characters usually are from the gradle.properties file, where exists some rules such us enable jetifier, or in my case, I have one like this:

org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"

It can be different from yours, but at least I hope the sintaxis of the instruction helps you to check if this is the source of error.

If it's not, please let me know and I'll try to help you.

Juan P.
  • 76
  • 8
  • Hi thanks for getting back to me, in my gradle.properties file mine looks like this: ```org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 ``` I'm not sure if this correct so any help would be great – nath Mar 01 '22 at 15:07
  • I see, It looks fine to me. Have you tried any of the solutions from this other post? https://stackoverflow.com/questions/19889132/error-the-processing-instruction-target-matching-xxmmll-is-not-allowed It looks that it shows because there is some error parsing an xml file. For example here: https://programmerclick.com/article/8813628177/ says It was a typing problem with xml format. Try checking out your xml format (I don't see any typo in your manifest). – Juan P. Mar 01 '22 at 15:44
0

In my case, the error was caused by a single whitespace character before the root tag <?xml version="1.0" encoding="utf-8"?>. AndroidManifest should start with this tag and no whitespaces are allowed.