Android resource compilation failed Output: C:\Users\DevoDev1\AndroidStudioProjects\Test\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1339: error: unescaped apostrophe in string "Who should feed "First Feed" or Anna Prasana to the baby? \n\n (a) Father \n (b) Mother \n (c) Uncle (Mother's Brother) \n (d) Grand Father (Month's father) \n\n Who else can feed first?". C:\Users\DevoDev1\AndroidStudioProjects\Test\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1339: error: not a valid string. C:\Users\DevoDev1\AndroidStudioProjects\Test\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1343: error: unescaped apostrophe in string "Lamp should be facing our side or God\'s side \n\n (a) To God side, because we are offering to God \n (b) Our side, because we need the God's grace on us \n (c) Doesn't matter \n\n What is your take?". C:\Users\DevoDev1\AndroidStudioProjects\Test\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1343: error: not a valid string. C:\Users\DevoDev1\AndroidStudioProjects\Test\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1455: error: unescaped apostrophe in string "Don't loosen your belt". C:\Users\DevoDev1\AndroidStudioProjects\Test\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1455: error: not a valid string.Command: C:\Users\DevoDev1.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\85067246fdfeb2b4bb965a42850c6b89\aapt2-3.2.0-4818971-windows\aapt2.exe compile --legacy \ -o \ C:\Users\DevoDev1\AndroidStudioProjects\Test\app\build\intermediates\res\merged\debug \ C:\Users\DevoDev1\AndroidStudioProjects\Test\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #0
1
votes
restart your android studio then clean and rebuild
– Abhinav Gupta
I have restarted the studio but showing the same error.
– divya
have you clean and rebuild the project
– Abhinav Gupta
yes, I have cleaned and rebuild.
– divya
then delete cache build files
– Abhinav Gupta
4 Answers
4
votes
The errors are in your strings file. Replace this strings
Who should feed "First Feed" or Anna Prasana to the baby? \n\n (a) Father \n (b) Mother \n (c) Uncle (Mother's Brother) \n (d) Grand Father (Month's father) \n\n Who else can feed first?
Lamp should be facing our side or God\'s side \n\n (a) To God side, because we are offering to God \n (b) Our side, because we need the God's grace on us \n (c) Doesn't matter \n\n What is your take?
Don't loosen your belt
With:
Who should feed \"First Feed\" or Anna Prasana to the baby? \n\n (a) Father \n (b) Mother \n (c) Uncle (Mother\'s Brother) \n (d) Grand Father (Month\'s father) \n\n Who else can feed first?
Lamp should be facing our side or God\'s side \n\n (a) To God side, because we are offering to God \n (b) Our side, because we need the God\'s grace on us \n (c) Doesn\'t matter \n\n What is your take?
Don\'t loosen your belt
You missed some apostrophe and some double quotes
2
votes
1
votes
0
votes
In my case, I had several apostrophes in the strings that were tagged with errors. Unfortunately, the Android Studio IDE does not red-underline all words with apostrophes if there are several apostrophes in a string, so it is very easy to miss apostrophes. Look carefully at the error report and double check the strings that are labeled. You may find that you escaped SOME of the apostrophes in the string, but not all of them