user1242617
user1242617

Reputation:

Cannot find my r.java file in android

Iam a newbie to android.I had crested an project to check the textfields avaiable in android. I added some resources in string.xml and build the project. My R.java is not generated automatically. I had choosed only "Build Automatically" from project tab. I had cleaned my project many times and restarted eclipse but my r.java is not generated. I cant find any error with my resource folder. Can anybody help me out of this? and also give me some instructions how to work with resource folder if possible?. please refer my activity.xml below.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".Text_MainActivity"> 

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/hello_world" />

<EditText
    android:id="@+id/email_address"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/textView1"
    android:layout_below="@+id/textView1"
    android:layout_marginTop="14dp"
    android:ems="10"
    android:hint="@string/email_hint"
    android:inputType="textEmailAddress"/>

<EditText
    android:id="@+id/launch_codes"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/email_address"
    android:layout_below="@+id/email_address"
    android:ems="10"
    android:hint="@string/enter_launch_codes"
    android:imeActionLabel="@string/launch"
    android:inputType="number"/>

<EditText
    android:id="@+id/postal_address"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/launch_codes"
    android:layout_below="@+id/launch_codes"
    android:ems="10"
    android:hint="@string/postal_address_hint"
    android:inputType="textPostalAddress"/>

<AutoCompleteTextView
    android:id="@+id/autocomplete"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/postal_address"
    android:layout_below="@+id/postal_address"
    android:layout_marginLeft="16dp"
    android:layout_marginTop="18dp"
    android:ems="10"
    android:hint="@string-array/countries_array">
</RelativeLayout>

Thanks in advance

Upvotes: 2

Views: 2014

Answers (2)

nanithehaddock
nanithehaddock

Reputation: 257

Before building your project, right click on Android project, goto --> Android tools ---> Fix project properties. after completed this, then right click on project and ---> build project

it may resolve your issue.

Upvotes: 0

frankish
frankish

Reputation: 6826

This has been asked many times before and possibly a duplicate question.

But again, you can try to Clean and Rebuild the project. If the problem continues, look into res/ folder, you'll probably see a red X icon that shows you that one of the XML files are broken. Fix that XML and it may work.

By the way, it seems like you are not closing AutoCompleteTextView tag in your xml.

Upvotes: 1

Related Questions