divya
divya

Reputation: 53

After i have updated my android studio its showing error like Android resource compilation failed.please help me

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

enter image description here

Upvotes: 1

Views: 1583

Answers (4)

Swathi
Swathi

Reputation: 1684

Faced the same problem after updating to 3.3.2. I ignored the current project and fresh clone or create a new project which solved the issue for me.

Upvotes: 1

user1608385
user1608385

Reputation: 649

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

Upvotes: 0

TimWeb
TimWeb

Reputation: 405

I had the same problem. Try to open values.xml via Project in android studio

C:\Users\DevoDev1\AndroidStudioProjects\Test\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml

find lines: 1339, 1343, 1455 and edit them.

Upvotes: 2

Lorenzo Vincenzi
Lorenzo Vincenzi

Reputation: 1212

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

Upvotes: 4

Related Questions