Android Firebase Crashlytics SAXParseException

After setup Firebase Crashlytics for my Android app, it prompt the following build warning for one of the res/value/*.xml files.

org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 39; Content is not allowed in prolog. at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)

It was caused by an accidental xml declaration <?xml version="1.0" encoding="utf-8"?> which isn't necessary.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    ...
</resources>

Removing <?xml version="1.0" encoding="utf-8"?> solved the problem.

<resources>
    ...
</resources>

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.