How to fix compile error in Android application where strings.xml contain invalid characters

I created an application with a string-array in the strings.xml file. Unfortunately, I left some apostrophe in one of the string values that was:
D’Souza

Obviously, at compile time, the Android Studio 2.2 IDE threw an error about invalid characters not preceded by a . I should have actually put the string as:
D’Souza

Now, I corrected the string value in the strings.xml file, but yet kept getting an error. Each time, a file values.xml would open in the IDE. All attempts to rebuild the project after cleaning it failed to fix the issue.

Finally, I decided to go to the command line and remove the file values.xml altogether. (Extreme issues require extreme solutions :-).

After deleting the file values.xml, rebuilt and recompiled the project and the app got compiled with no errors.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s