-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AndroidManifest.xml Build errors using VS Mac, Xamarin Forms Android #6385
Comments
@yetibyte can you provide a diagnostic build log which contains the error? |
I suspect part of the problem is in (1) "use this AndroidManifest.xml": <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.mycompany.myapp" android:versionCode="21" android:versionName="1.21">
… Note the leading space. This isn't valid; "everything" doesn't like it.
var d = XDocument.Parse("x.xml");
// System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1. I haven't tried using a Java XML parser, but it wouldn't surprise me that invalid XML was responsible for the reported error message:
Does |
That said, if I change e.g.
|
Hello jonpryor, thanks for comments, the leading space is not present in the files, is just my copy paste error into this issue description, apologies. |
Hello dellis1972, thanks for you help, have added the build log here with full diagnostic output. |
@yetibyte could you also upload the following file |
@yetibyte actually, you might not be able to. I that file gets deleted after the task executes. |
Hello @dellis1972, this bug still remains, am trying to find if there is an equivalent manifest merge view in VS mac similar to the Android Studio function developer.android.com/studio/build/manage-manifests? |
There is not equivalent manifest merge view in VS Mac I'm afraid. Looking at the build log you provided, in addition to your AndroidManifest.xml the following are all the additional files which
If you want to know which library or project these files come from there is a I suspect one of these files has got a problem which is causing manifest merger to fail. |
@dellis1972 obj/Debug/lp/142/jl/AndroidManifest.xml Listing below, it is missing the final ">" on line 35, column 11. Have yet to find out why the missing character in the Firebase library, but will do. So thanks again. For future iterations, I think someone needs to add a few lines to the merger scripts to output the directory/filename of the problematic AndroidManifest.xml file. In my case, I had 140+ files to search through and was originally misdirected due to an unfortunate coincidence that the error reported on line 35, column 11 exactly matched the length of my properties/AndroidManifest.xml file. `
</manifest |
Glad you found the issue. We are going to add #6397 which will let people gather additional output which will help track down the issue. |
Strange problem with Manifest Merger, Visual Studio Mac, Xamarin Forms (5.0.0.2125), Android project, SDK 29 to 30. Problem initiated during an aborted simulator build which generated the error below, indicating the xml structure wasn't closed; line 35, column 11 being was the last line and character of the Properties/AndroidManifest.xml.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error AMM0000: Error: org.xml.sax.SAXParseException; lineNumber: 35; columnNumber: 11; XML document structures must start and end within the same entity. (AMM0000)
So, I checked the AndroidManifest.xml, changed a few things and now the obj/debug/AndroidManifest.xml is created and looks right, however, the build errors remain the same.
Subsequent complete rewrites and edits of the Properties/AndroidManifest.xml file have only 2 outcomes:
So, is something cached somewhere?
Have tried quite few things including:
Steps to Reproduce
Expected Behavior
Project builds with no errors
Actual Behavior
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error AMM0000: Error: Exception while merging manifests (AMM0000) (Myapp.Android)
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error AMM0000: Error: org.xml.sax.SAXParseException; lineNumber: 35; columnNumber: 11; XML document structures must start and end within the same entity. (AMM0000) (Myapp.Android)
Environment
Build Logs
Example Project (If Possible)
The text was updated successfully, but these errors were encountered: