Search Issue Tracker

Won't Fix

Votes

0

Found in

2021.3.47f1

2022.3.55f1

6000.0.33f1

6000.1.0a9

Issue ID

UUM-91586

Regression

No

AndroidManifest.xml detects the “<” symbol between tags as invalid and outputs an "System.Xml.XmlException" error failing the build

--

-

Steps to reproduce:
1. Open the attached user's project "Test22353.zip"
2. Switch to Android and build
3. Observe the console error

Expected results: The previous XML format should still work with newer versions of the editor despite the Gradle and AGP upgrades
Actual results: AndroidManifest.xml detects the “<” symbol between tags as invalid and outputs an "System.Xml.XmlException" error failing the build

Reproducible: 2021.3.47f1, 2022.3.55f1, 6000.0.33f1, 6000.1.0a9

Testing Environment: Windows 11 23H2
Not reproducible on: no other environment tested

Notes:
-Workaround: Open the AndroidManifest.xml file -> Go to line 6 and erase the “<” character at column 92 -> Try the build. It should work now
-User reported that the issue does not reproduce on 2022.3.37f1 (assigning <google_ad_manager_app_id> dynamically) and reproduces with 2022.3.38f1, however I could reproduce the issue below 2022.3.38f1
-Gradle and AGP upgrade from 7.2 to 7.5.1 and 7.1.2 to 7.4.2 coincides with 2022.3.38f1 reproducing the issue for the user
-The XML files passes validators. The issue only happens with the “<” character, if the “>" character is left there are no problems. It seems to be an issue with the XML parser
-Error message:
System.Xml.XmlException: '<', hexadecimal value 0x3C, is an invalid attribute character

  1. Resolution Note:

    Unity uses the standard C# System.XML parser, <, > and & are reserved in XML, they must be encoded with &lt; &gt; and &amp; if they're not part of tags. We cannot reproduce the fact it used to work on earlier versions (all versions throw the Xml error with un-encoded < character). If we can get a reproduction that shows a distinct regression then we can re-investigate this ticket. However, I would suggest using different characters to mark out dynamically replaceable text in XML.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.