簡體   English   中英

XML錯誤,獲取錯誤Android中values.xml中的意外結束標記字符串

[英]Xml error ,getting error Unexpected end tag string in values.xml in android

我在資源開始標記和結束標記處出現紅線,在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  

這些不會輸入值...請將它們粘貼到您的字符串文件中。

<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>

注意:值文件僅接受面向屬性的標簽。

你弄錯了。

是resource(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"/>

將以下字符串保留在您的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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM