Solutions to Android layout XML parsing errors

Tips:

org.xmlpull.v1.XmlPullParserException: PI must not start with xml (position:unkNown @1:5 in java.io. InputStreamReader@47ec2770 )

org.xml.sax.SAXParseException: PI must not start with xml (position:unkNown xm@3 :5 in java.io. InputStreamReader@43e4b480 )

After multiple searches, it is confirmed that the XML syntax is correct.

Cause of problem:

The format of the first line of the XML file is incorrect. You can modify the first line carefully

<? xml version="1.0" encoding="utf-8" ?> (the specific reason is unknown. If you delete this line, you can preview it successfully.)

More reasonable solution:

Delete the XML document, rebuild the XML document through the system new - > other - > Android XML file, and then copy or enter the XML document content again.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>