Error in strings.xml file in Android

前端 未结 9 617
[愿得一人]
[愿得一人] 2020-11-28 04:37

I have declared a long string in string.xml of an application.

Declared like this

PLEASE READ THESE TERMS          


        
9条回答
  •  北海茫月
    2020-11-28 05:35

    1. for error: unescaped apostrophe in string

    what I found is that AAPT2 tool points to wrong row in xml, sometimes. So you should correct whole strings.xml file

    In Android Studio, in problem file use :

    Edit->find->replace

    Then write in first field \' (or \&,>,\<,\")
    in second put '(or &,>,<,")
    then replace each if needed.(or "reptlace all" in case with ')
    Then in first field again put '(or &,>,<,")
    and in second write \'
    then replace each if needed.(or "replace all" in case with ')

    2. for other problematic symbols
    I use to comment each next half part +rebuild until i won't find the wrong sign.

    E.g. an escaped word "\update" unexpectedly drops such error :)

提交回复
热议问题