Avin Sharma
Avin Sharma

Reputation: 1

Creating new project displaying error in android

Regards.I have some problem whenever i create new android project in eclipse,it is showing error. Error is in "R" class,i guess i am not able to create R class in my project. It is showing R with under red line when i look into MainActivity.java class. Between,i have installed window and all the android-sdk and plug-in cuz i had some window issue previously but now eclipse is not working with new projects. Please help me to resolve out the problem.

Upvotes: 0

Views: 94

Answers (4)

newBie
newBie

Reputation: 118

First of all just check if by mistake you have imported amndroid.R in your imports. If yes then remove that line and clean and refresh you project. IF the probem still exists try adding few widgets as button or textview or anything in your main xm and clean it rebuild it and try to run. If you do some change in xml file you R.java gets generated automatically.

Upvotes: 0

falcon
falcon

Reputation: 362

First of all try to update ADT plugin by Help -> Check of Updates.

Next open Project Properties -> Java Build Path.

In 'Source' Tab must be 'gen' folder.

'Order and Export' Tab must be in this order:

  1. projectName/src
  2. projectName/gen
  3. Android x.x
  4. Android Private Libraries
  5. Android Dependencies

!!! 4 & 5 must be selected in checkbox !!!

Upvotes: 0

Pavan Tilak
Pavan Tilak

Reputation: 153

-> First close My-eclipse.

-> delete/rename existing workspace.

-> delete .android folder that exists in your Computer User accounts.

-> Just run eclipse with Administrator Privileges.

Then problem is solved..

Upvotes: 1

Luser_k
Luser_k

Reputation: 534

Turn on Project -> Build automatically in eclipse. This will generate new R.java file. Look into your gen-package, if the R.java is available.

Upvotes: 0

Related Questions