bstack
bstack

Reputation: 2528

R.java not being generated for new Android project

When I create a new android project in Eclipse, and I choose to have a default main activity, my R.java file does not get generated.

I have seen some questions online and on this site about R.java not being generated but all are due to some manual action/mistake that had to be corrected during the development of the application.

However, does anyone know why R.java would not get generated for a brand new android project, where I have made no manual modifications whatsoever?

Upvotes: 3

Views: 6608

Answers (4)

TrueCoke
TrueCoke

Reputation: 2426

ADT version 22 requires that you install "build tools". To get it to work i had to update:

  • SDK Tools
  • Platform Tools

Then install:

  • Build Tools

This link recommends you add build tools to your environment path. I had to do the following before the R.java was generated:

  1. Append build tools to PATH environment variable
  2. Restart Eclipse.

Upvotes: 1

anddevmanu
anddevmanu

Reputation: 1459

R.java creates every time when you create android project first time r.java created by default

so check for the errors and clean the project.

Upvotes: 0

Rohit
Rohit

Reputation: 11

Make sure your project is free of errors and problems. You can use Windows-View to find and rectify them. Common mistakes are in the layout files. Check the AndroidManifest file and see if the activity names match the classes in your source folder. Clean and rebuild.

Upvotes: 0

lopez.mikhael
lopez.mikhael

Reputation: 10081

I think your problem is just the latest update of the SDK.

Test the following operations on two projects :

  • In the project properties (eclipse) -> java build path -> order and export make sure that all your jars in the libs folder are checked.
  • And "Android Tools -> Fix Project Properties"
  • And "Project -> Clean"

I hope you have helped!

Upvotes: 3

Related Questions