chandan paliwal
chandan paliwal

Reputation: 37

why from my eclipse R file is deleted?

Gen folder is in project explorer but R file is not there. it showing error on the (R.layou.main).

package org.example.Wardrobe;

import android.app.Activity;
import android.os.Bundle;

public class Start extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
} 

Upvotes: 2

Views: 1349

Answers (4)

Jaydeep Khamar
Jaydeep Khamar

Reputation: 5985

There will be some error in one of your xml file. fix that error, save your project and rebuild. R. java will be created.

Upvotes: 2

Amokrane Chentir
Amokrane Chentir

Reputation: 30385

Generally when Eclipse doesn't generate the R.java file is when there is a problem occuring somewhere. Do you really have a main.xml layout? If you are sure that everything is fine, do a Project -> Clean and everything should be fine.

Upvotes: 1

Ritesh
Ritesh

Reputation: 326

try one more time create one more project then check R.java exist or not.if not then there is some problem in installation process.i installed and R.java file exist in it.

Upvotes: 0

Sriram
Sriram

Reputation: 10558

Just do a clean from Project->Clean and then Build the project again. That should get the R class generated again and your errors should disappear.

Upvotes: 2

Related Questions