Eclipse does not generate class R

Asked

Viewed 2,382 times

1

Lately I am not able to develop anything, because the ADT Eclipse is problematic, I have downloaded several, in different computers and the error persists.

When creating any project below 4.0, the eclipse does not generate the R class. Does anyone know what this might be? I’ve given clean, I checked the SDK, downloaded another ADT , I installed virtually everything there in the SDK Manager, and nothing.

  • One of the reasons for not generating this file may be error related in some of your XML files. Have you checked to see if there is any flaw you haven’t seen before?

  • What fault? because I create a project and already comes with the error, I already checked the xml yes and I see nothing wrong.

  • 1

    Try looking at this link: http://stackoverflow.com/questions/2757107/developing-for-android-in-eclipse-r-java-notgenerating

  • I’ve seen it, I’ve tried those steps, but without success. But it’s always worked here, and now you’re making that mistake, both at the company and at home. When you create the project, you create only buildConfig, but no R

3 answers

1


Are you using a library/project as a dependency on your project? Sometimes, when there is an error with a dependency, the R class is not actually generated. A classic example is when you use the v7 support library, which depends on v4 and you forget to put v4 as a dependency on v7. In this case, your project does not generate the R class because your project references resources defined in the v4 support library but it cannot find.

If you are using the v7 compatibility library, make sure you have followed all the steps shown on the website of Support Library Setup for Android.

Follow the tutorial presented in the section "Adding Libraries with Resources" because your problem is when generating R class, you need references to libraries Resources.

  • I think that’s it, because I’m creating projects for 2.2/ 2.3 , I created here with 4.4 and it worked! but I need to create 2.2 projects, how do I create or import 2.2? when I also care about the error in style.xml there on Theme.light, I have already made the settings of appcompat v7 but can’t run

  • no properties dos projetos 2.2, fica assim target=android-20 android.library.Reference. 1=.. /appcompat_v7

  • Are you using appcompat_v7? If so, have you tried importing appcompat_v4 as well? See if the edit I made in my reply helps you. If not, explain exactly what compatibility libraries you’re using for me to help right.

0

I don’t know if you managed to solve your problem, but by cracking your head a little bit...

I created in the new project, with version 4.0 and after created so the R Class is created normally, then went into project properties and changed to 2.3.3 and it worked...

hope I’ve helped

0

This was with me on Linux. One solution at the time I found was to change distro or download eclipse, not adt, and install the old-fashioned plugin!

You ever do that? If not, do the following: download the eclipse Juno, go to Help -> Install New Software, on the Add button, put any name and in the field below, add this link, https://dl-ssl.google.com/android/eclipse/ . Check the options that appear, and install normally! Restart the eclipse, create a project and comment here if it worked!

Good luck!

  • I downloaded the eclipse Luna ( last version) and did it, from the same thing. I just tested on a third computer downloading the adt, and the problem persists! unfortunately I can not program anything

  • Boy.. bizarre what’s happening to you seen?! The latest solutions I see is using Android Studio or Netbeans configured for Android.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.