Xml错误,获取错误android

时间:2017-12-28 12:14:06

标签: java android xml android-resources

我在资源开始标记和结束标记处获得红线,并且在标记Sciatica4我收到错误

  

错误:(1616)意外的结束标记字符串

     

错误:(1616)在非位置指定的多个替换   格式;你的意思是添加formatted =“false”属性吗?

     

错误:任务':app:processDebugResources'的执行失败。   com.android.ide.common.process.ProcessException:无法执行   AAPT

Values.xml

     <?xml version="1.0" encoding="utf-8"?>
  getting red line here  ---- >    <resources xmlns:ns1="http://schemas.android.com/tools">
                <attr format="reference" name="constraintSet"/>
                <attr format="reference" name="drawerArrowStyle"/>
                <attr format="dimension" name="height"/>
                <attr format="boolean" name="isLightTheme"/>
        .
        .
        .

 <string name="Sciatica1">  Turmeric: Add 1 teaspoon of turmeric to 1 cup of milk. You can also add a small cinnamon stick. Boil the solution. Sweeten this healthy drink with honey and drink it once or twice daily until you see improvement.</string>
    <string name="Sciatica2">  Valerian Tea: Drink valerian tea prepared by steeping 1 teaspoon of dried valerian root in 1 cup of hot water for 10 minutes. Drink this herbal tea several times a week for a few weeks.</string>
    <string name="Sciatica3">  Hot or Cold Compresses: Place a hot or cold pack on the affected area for 15 to 20 minutes.Do this every few hours until you get relief.</string>
   <string name="Sciatica4"> Capsaicin Cream: Buy a cream or ointment containing 0.025% to 0.075% capsaicin.Apply it on the affected area up to 4 times a day, at least for 1 week.</string>
    .
    .
    .

    </resources><----getting red line here  

3 个答案:

答案 0 :(得分:0)

这些不是值...请将它们粘贴到您的字符串文件中。

<string name="Sciatica1">  Turmeric: Add 1 teaspoon of turmeric to 1 cup of milk. You can also add a small cinnamon stick. Boil the solution. Sweeten this healthy drink with honey and drink it once or twice daily until you see improvement.</string>
<string name="Sciatica2">  Valerian Tea: Drink valerian tea prepared by steeping 1 teaspoon of dried valerian root in 1 cup of hot water for 10 minutes. Drink this herbal tea several times a week for a few weeks.</string>
<string name="Sciatica3">  Hot or Cold Compresses: Place a hot or cold pack on the affected area for 15 to 20 minutes.Do this every few hours until you get relief.</string>
<string name="Sciatica4"> Capsaicin Cream: Buy a cream or ointment containing 0.025% to 0.075% capsaicin.Apply it on the affected area up to 4 times a day, at least for 1 week.</string>
  

注意:值文件只接受面向属性的标记。

答案 1 :(得分:0)

你弄错了。

是资源(res)目录中的文件夹。

您必须将所有字符串内容粘贴到 strings.xml

<string name="Sciatica1">  Turmeric: Add 1 teaspoon of turmeric to 1 cup of milk. You can also add a small cinnamon stick. Boil the solution. Sweeten this healthy drink with honey and drink it once or twice daily until you see improvement.</string>
    <string name="Sciatica2">  Valerian Tea: Drink valerian tea prepared by steeping 1 teaspoon of dried valerian root in 1 cup of hot water for 10 minutes. Drink this herbal tea several times a week for a few weeks.</string>
    <string name="Sciatica3">  Hot or Cold Compresses: Place a hot or cold pack on the affected area for 15 to 20 minutes.Do this every few hours until you get relief.</string>
   <string name="Sciatica4"> Capsaicin Cream: Buy a cream or ointment containing 0.025% to 0.075% capsaicin.Apply it on the affected area up to 4 times a day, at least for 1 week.</string>

在您的res目录中使用.make attrs.xml 并将其粘贴到其中。

<attr format="reference" name="constraintSet"/>
                <attr format="reference" name="drawerArrowStyle"/>
                <attr format="dimension" name="height"/>
                <attr format="boolean" name="isLightTheme"/>

答案 2 :(得分:0)

将以下字符串保留在 string.xml 文件

 <string name="Sciatica1">  Turmeric: Add 1 teaspoon of turmeric to 1 cup of milk. You can also add a small cinnamon stick. Boil the solution. Sweeten this healthy drink with honey and drink it once or twice daily until you see improvement.</string>
    <string name="Sciatica2">  Valerian Tea: Drink valerian tea prepared by steeping 1 teaspoon of dried valerian root in 1 cup of hot water for 10 minutes. Drink this herbal tea several times a week for a few weeks.</string>
    <string name="Sciatica3">  Hot or Cold Compresses: Place a hot or cold pack on the affected area for 15 to 20 minutes.Do this every few hours until you get relief.</string>
   <string name="Sciatica4"> Capsaicin Cream: Buy a cream or ointment containing 0.025% to 0.075% capsaicin.Apply it on the affected area up to 4 times a day, at least for 1 week.</string>