0

I'm trying to implement facebook login in my app so I followed facebook instructions and I needed to create strings.xml file because I didn't have this file, but when I start the app I get this error:

Execution failed for task ':app:mergeDebugResources'.

Error: The processing instruction target matching "[xX][mM][lL]" is not allowed.

My strings.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">name</string>

    <string name="facebook_app_id">00000000000</string>

    <string name="fb_login_protocol_scheme">fb000000000000</string>

</resources>

What should I do to solve this problem?

Community
  • 1
  • 1
Noam
  • 485
  • 1
  • 7
  • 18

1 Answers1

1

Leave out the <?xml ...> XML declaration alltogether. This error is reported when an XML declaration (which is syntactically an SGML processing instruction) is found in XML other than at the beginning of the XML. So I'm guessing the XML is composed/appended to some other XML in your app (it's impossible to say without additional info). An XML declaration is optional anyway; it's only used to tell a parser the encoding of the document, and that markup should be parsed according to XML rules (rather than HTML or generic SGML rules). You also might want to double-check you put no invisible garbage characters (by string operations in your app code) into your XML.

imhotap
  • 2,275
  • 1
  • 8
  • 16