2

I am getting this error:

error: Error: No resource found that matches the given name (at 'text' with value '@string/_____').

i changed the string name many time but i'm still getting it. What's wrong with my codes? it was working before.But now it is not working.

xml:

<?xml version="1.0" encoding="utf-8"?>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <LinearLayout              
        android:id="@+id/topLayout"
        android:layout_width="fill_parent"             
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

                <EditText
                    android:id="@+id/editTextMessage"
                    android:layout_width="fill_parent"
                    android:layout_height="100dp"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentTop="true"
                    android:layout_marginTop="20dp"
                    android:ems="10"
                    android:hint="@string/message"
                    android:singleLine="false" >

                     </EditText>

                <EditText
                    android:id="@+id/editTextNumber"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="40dp"
                    android:layout_below="@+id/editTextMessage"
                    android:ems="10"
                    android:inputType="phone" >   
                </EditText>

                <Button
                    android:id="@+id/buttonContact"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignBaseline="@+id/editTextNumber"
                    android:layout_alignBottom="@+id/editTextNumber"
                    android:layout_alignParentRight="true"
                    android:text="@string/contact" />

                <Button
                    android:id="@+id/buttonTimePickup"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_below="@+id/buttonContact"
                    android:layout_marginTop="40dp"
                    android:text="@string/time" />  <--- the error appears on this line

                <Button
                    android:id="@+id/buttonDatePickup"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignBaseline="@+id/buttonTimePickup"
                    android:layout_alignBottom="@+id/buttonTimePickup"
                    android:layout_alignParentRight="true"
                    android:layout_marginTop="40dp"
                    android:text="@string/date" /> <-- the error appears on this line

                <TextView
                    android:id="@+id/textView1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_below="@+id/buttonDatePickup"
                    android:layout_marginTop="40dp"
                    android:text="@string/frequency"  <--the error appears on this line
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textSize="25sp" />

                <RadioGroup
                       android:id="@+id/radioGroup"
                       android:layout_width="fill_parent"
                       android:layout_height="wrap_content"
                       android:orientation="vertical"
                       android:layout_below="@+id/textView1"
                       android:layout_centerHorizontal="true"
                       android:layout_marginTop="20dp">

                        <RadioButton
                            android:id="@+id/oneTime"
                            android:layout_width="160dp"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:text="@string/onetime" /> < error appears on this line

                       <RadioButton
                           android:id="@+id/fifteenMinutes"
                           android:layout_width="160dp"
                           android:layout_height="wrap_content"
                           android:layout_gravity="center"
                           android:text="@string/fifteen" /> <-- error appears on this line

                       <RadioButton
                           android:id="@+id/halfHour"
                           android:layout_width="160dp"
                           android:layout_height="wrap_content"
                           android:layout_gravity="center"
                           android:text="@string/halfhour" /> <-- error appears on this line

                       <RadioButton
                           android:id="@+id/hour"
                           android:layout_width="160dp"
                           android:layout_height="wrap_content"
                           android:layout_gravity="center"
                           android:text="@string/anhour" /> <-- error appears on this line

                       <RadioButton
                           android:id="@+id/halfDay"
                           android:layout_width="160dp"
                           android:layout_height="wrap_content"
                           android:layout_gravity="center"
                           android:text="@string/halfday" /> <-- error appears on this line

                       <RadioButton
                           android:id="@+id/daily"
                           android:layout_width="160dp"
                           android:layout_height="wrap_content"
                           android:layout_gravity="center"
                           android:text="@string/daily" /> <-- error appears on this line

                       <RadioButton
                           android:id="@+id/weekly"
                           android:layout_width="160dp"
                           android:layout_height="wrap_content"
                           android:layout_gravity="center"
                           android:text="@string/week" /> <-- error appears on this line

                       <RadioButton
                           android:id="@+id/monthly"
                           android:layout_width="160dp"
                           android:layout_height="wrap_content"
                           android:layout_gravity="center"
                           android:text="@string/month" /> <-- error appears on this line

                        <RadioButton
                            android:id="@+id/Yearly"
                            android:layout_width="160dp"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:text="@string/year" /> <-- error appears on this line

                 </RadioGroup>

                <Button
                    android:id="@+id/buttonConfirm"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_below="@+id/radioGroup"
                    android:layout_marginTop="40dp"
                    android:text="@string/confirm" /> <-- error appears on this line

            </RelativeLayout>

        </LinearLayout>

   </ScrollView>

I'm stuck on this one.

Stephen
  • 9,899
  • 16
  • 90
  • 137
Chix
  • 73
  • 1
  • 6
  • If you have confirmed that you have that value correctly in your `strings.xml` then [try cleaning your project](http://stackoverflow.com/questions/17371281/element-type-button-must-be-followed-by-either-attribute-specifications-o/17371305#17371305) – codeMagic Mar 18 '14 at 22:34

3 Answers3

4

Go to res->values->strings.xml and add next lines inside:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="time">time</string>
    <string name="date ">date</string>
     .............. etc for each string resource that you need
</resources>
Divers
  • 9,531
  • 7
  • 45
  • 88
1

Add these Xml Code in res/values/strings.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="time">time</string>

    <string name="date">date</string>

    <string name="frequency">frequency</string>

    <string name="onetime">onetime</string>

    <string name="fifteen">fifteen</string>

    <string name="halfhour">halfhour</string>

    <string name="anhour">anhour</string>

    <string name="halfday">halfday</string>

    <string name="daily">daily</string>

    <string name="week">week</string>

    <string name="month">month</string>

    <string name="year">year</string>

    <string name="confirm">confirm</string>

</resources>

if you are getting the error:No resource found that matches the given name (at 'text' with value '@string means you are not referring the names to the String.Just add these String names.Then it will not be occurred.

Stephen
  • 9,899
  • 16
  • 90
  • 137
0

Check strings.xml file to make sure it has a value called "time".

After that, sometimes when you edit one of your resource files, you need to rebuild the project. This will recreate the R.* files, where your ide and the xml parser checks to see if you actually have a string called that.

Hope that helps.