Error: (218) An apostrophe that is not preceded by \

In my strings.xml file, I created a line containing (it), and I get this error.

Error: (218) Apostrophe, which is not preceded by \

Yes, I know that I need to either put in front of the apostrophe, or just delete the apostrophe, but my problem is that when I launch the application using (it \ s) or just deleting it, it returns; even if I delete the entire line, everything returns when I click run. How to stop it?

Here's the line, but it really doesn't matter. I just want it to be deleted and not restored when the application starts.

<string> name="talk" So, you want these things? LOL its gonna</string> 
+5
android string xml
Feb 24 '16 at 1:57
source share
4 answers

When an error occurs, Android Studio opens the values.xml file, which at that moment in the file looks deceiving exactly like your strings.xml. Make sure you update the strings.xml file and you should be good to go.

+9
06 Oct '16 at 20:05
source share

In fact, there are two files: strings.xml and values.xml

We edit our string data in the strings.xml file and whenever we get an error, such as Apostrophe, which is not preceded by \, when you click on the error, the android studio group redirects you to values.xml, and you edit in values .xml and android studio just deleted what you edited.

So make sure you edit strings.xml not values.xml

+1
May 18 '17 at 7:25 a.m.
source share

try

 <string name="talk">your string value</string> 
0
Jul 26 '16 at 15:46
source share

Put your string in double quotes. <string>"Your text 'here'"</string>

0
Jul 27 '16 at 12:48
source share



All Articles