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>
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.
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.
Related
Whenever trying to run the app, getting the error:
"Could not identify launch activity: Default Activity not found".
I have seen a few other threads on the same issue, but the below solutions have not worked for me:
Invalidating gradle cache and re-running
Manually overriding in the edit configuration tab to select the default activity (it then says "The activity 'MainActivity' is not declared in AndroidManifest.xml" even though it is!)
Re-syncing the gradle files
Literally shuffling around the order of the activities in my manifest
Using the long name for my activities, but doesn't make any difference
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mywebname">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<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/AppTheme">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ListenScreen"
android:parentActivityName=".MainActivity"
android:screenOrientation="portrait">
</activity>
</application>
</manifest>
```
As you can see, I have clearly declared the activities (my app only has 2 so far), and I've put the intents around the ".MainActivity".
This answer worked for me after trying so many other tweaks, just adding the package name solved my problems
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.name">
https://stackoverflow.com/a/72300233/8720836
You can only have to add the package name inside the manifest tag you can find your package name inside app.gradle file and you are good to go
So, I think I accidentally deleted something from the manifest, but I am using AIDE and I no longer have the option to undo it. I've looked through examples on StackOverflow and throughout the general Internet, trying to find the problem with the manifest, but nothing seems to be missing. The error is showing after the android:label line in <activity>.
Before supposedly deleting something, the app compiled and ran as expected. Thanks to anyone that can help.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bitcoin.app" >
<uses-permission android:name = "android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<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>
</activity>
</application>
</manifest>
It means there is a compilation error in your XML file, something that shouldn't be there: a spelling mistake/a spurious character/an incorrect namespace.
Check your #string file and XML file.
Eg: android:text="#string/hello";
a semicolon that shouldn't be there after this line
i had a problem, the Android Studio give me a warning which say:
"The acitivity is not declared in Android Manifest" this appear when i look on the Edit Configuration.
I see in another topic wich says that i have to put in androidManifest.xml
But i already did, and the Android Studio doesnt take it.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.drdower.myapplication" >
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".AplicacionSencillaInicio"
android:label="#string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".AplicacionSencillaResultado"
android:label="#string/app_name"/>
</application>
</manifest>
Which problem could be?
Thank u!
copy the code
delete the activity class
recreate one with same name
paste the code
Place your whole package path
com.example.drdower.myapplication.AplicacionSencillaInicio
Then clean your Project.
Also make sure you passed the correct java file name.
My R file is not generated after I clean my project. And according to my research on stack overflow, I think I have an error in my xml file but I dont know which xml contains the bug. I went through all of them including the AndroidManifest file.
Is there any way or tool to help me find out which xml contains the error? I have been stuck with this problem for like 10 hours. Please Help!
p.s
I have 2 different custom view where both have the same namespace (but uses in separate xml file), is that a problem?
AndroidManifest file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.packagename.appname"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="15" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.Holo.NoActionBar.Fullscreen" >
<activity
android:name="com.packagename.appname.activity.SplashScreenActivity"
android:icon="#drawable/ic_app"
android:label="#string/app_name"
android:noHistory="true" >
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voice_trigger" />
</activity>
<activity
android:name="com.packagename.appname.activity.MainActivity"
android:enabled="true"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.packagename.appname.activity.SelectActionActivity"
android:enabled="true"
android:label="#string/app_name" >
</activity>
</application>
</manifest>
Problems View
Found the bug... I declared the same id twice in the ids.xml. I would like to share how I found which xml contains the error. So I copied out individual xml content and deleting them from the project to see if the R file would generated. For all the non-xml, I set them to not including into build path for the time being. Its not the best way to find a error but it is a way. Thanks for everyone who reply to question. Happy coding.
I keep getting an error that says, "Element type "application" must be followed by either attribute specifications, ">" or "/>"."
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.thenewboston.sammy"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
I'm getting the error right below this:
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
This is the right form, see if you didn't close some tags.
<application android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
...>
<activity ...>
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
As my friend said , check the right format
For me It was like this :
BEFORE :
<activity android:name=".DisplayMessageActivity" android:label="display_message_activity"
</activity>
AFTER:
<activity android:name=".DisplayMessageActivity" android:label="display_message_activity" >
</activity>
Then the error disappeared
In my case, a comment had been placed (by the build tools?) inside the application tag:
<application android:allowBackup="true"
<!-- android:debuggable="true" -->
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/GdxTheme">
After I removed the entire debuggable=true comment line - everything worked.
I just ran into this error for a completely different reason. For some reason Android Studio had replaced every instance of the string name with "name" (e.g. it wrapped them all in double quotes) in my XML. It completely broke everything.
I had to clear out the double quotes from everything, clean the project and rebuild it.
If you're a flutter developer and you're getting this exception you must know there are two AndroidManifest file in your flutter project. One is inside debug folder and another one is main folder. My main folder AndroidManifest is ok and well formatted but AndroidManifest in debug folder is not ok and not well formatted due to a git conflict.
you must fix this.