Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

string does not contain a valid string resource. Android Studio

I get this error message:

> Task :app:mergeDebugResources
C:\Users\user\Desktop\Kotlin Projects\Projects\10000Months\app\src\main\res\values\strings.xml:51:4: Failed to flatten XML for resource 'Turn_Your_Ideas_into_Product' with error: Attempting to flatten xml with unfinished spans.
C:\Users\user\Desktop\Kotlin Projects\Projects\10000Months\app\src\main\res\values\strings.xml:51:4: string/Turn_Your_Ideas_into_Product does not contain a valid string resource.
C:\Users\user\Desktop\Kotlin Projects\Projects\10000Months\app\src\main\res\values\strings.xml:65:4: Failed to flatten XML for resource 'Write_a_Short_Book' with error: Attempting to flatten xml with unfinished spans.
C:\Users\user\Desktop\Kotlin Projects\Projects\10000Months\app\src\main\res\values\strings.xml:65:4: string/Write_a_Short_Book does not contain a valid string resource.

whenever I use these strings (below) in values->strings in Android Studio. Please take a look at them what should I add or remove;

<!--Record Your Conversations-->
    <string name="Record_Your_Conversations">
        <font size="17">Record Your Conversations</font>\n
        <font size="13">Is there a subject that you\'re exceptional knowledgeable about? Or even a subject that you\'re really interested in diving into a little deeper? Are you a good listener?…</font>
    </string>


<!--Write a Short Book-->
    <string name="Write_a_Short_Book">
        <font size="17">Write a Short Book</font>\n
        <font size="13">Writing a book is not easy, but we\'ll assist you, and this is especially good avenue to take if you're not interested in audio, video, or physical products…</font>
    </string>

Edit:

I have other similar strings, like this one:


<!--Teach People What You Know-->
    <string name="Teach_People_What_You_Know">
        <font size="17">Teach People What You Know</font>\n
        <font size="13">I bet you know things. Things that other people don\'t know. Music, sales, yoga etc. These are things people are constantly learning…</font>
    </string>

It works for them, I don't know what is wrong with the other 2 strings..

Thanks for your help..

like image 821
Edwin Avatar asked Apr 14 '26 23:04

Edwin


1 Answers

There's your problem, you've got an unescaped quote in Write_a_Short_Book:

take if you're not interested

You didn't post Turn_Your_Ideas_into_Product (the other one in your error log) but it's probably the same issue

like image 133
cactustictacs Avatar answered Apr 16 '26 13:04

cactustictacs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!