1

I'm trying to build my first Android App using Eclipse. I have looked at many different questions about R on stackoverflow and cannot seem to find the solution to my problem. I am following a course on building Android apps, and I am seemingly having problems with my gen file.

On the video tutorial the Gen file is able to be opened to show the generated files. On my project, the Gen file is not able to be opened and shows nothing in it. I have attached a screenshot of my Package Explorer to show what I mean.

What can I do to fix the R cannot be resolved as a variable problem. I have tried many different approaches from Stackoverflow, and am not able to get it working. Thanks for any help.

EDIT: I have attached another screenshot that includes the errors. I have done no coding, I have just started a new project, and am immediately given the error prompts. When I've tried to do any coding, I am unable to run the program due to the R errors. enter image description here enter image description here

3
  • try with clean and build. Also remove the android.jar file and right click on project and click fix project dependencies. Hope it will work Commented May 2, 2014 at 17:14
  • see this answer : stackoverflow.com/questions/23170010/… Commented May 2, 2014 at 17:29
  • The R file would not generate when there are errors in your code. Check where the errors are and fix them. Copy and paste the errors here so we can guide you better. Commented May 2, 2014 at 17:45

2 Answers 2

1
  1. Make sure you installed the Android build tool form sdk manager.
  2. Try clean project(project->clean), restart Eclipse
  3. Check any of your xml files have errors or not .Also any unsupported files in your /res folder
Sign up to request clarification or add additional context in comments.

Comments

0

Check if you have imported android.R.java..If yes, then delete that import.. It should be package.R.java ..

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.