Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 692
bstack Avatar asked Mar 12 '26 07:03

bstack


2 Answers

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!

like image 187
lopez.mikhael Avatar answered Mar 13 '26 21:03

lopez.mikhael


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.
like image 41
TrueCoke Avatar answered Mar 13 '26 21:03

TrueCoke



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!