Search code examples
androidresourcesr.java-filegenerated

Resource folder duplicated automatically in android


I just added a new xml file to my android project and started getting the error 'R cannot be resolved to a variable'. There are lot of questions and answers when I google it and also in stack overflow. When I clean the project, a new empty folder is automatically generated having the same name as my resource folder('res').

Also I found no errors in my xml files. Also I found that the generated java files folder is empty. I am getting the same error for all the projects in eclipse.

What could be the problem?

  <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" />

</LinearLayout>

Thanks in advance for any help.


Solution

  • I was using an image file who's name contains characters that are not allowed. I just renamed the image.