Leo Messi
Leo Messi

Reputation: 822

Android : R class stopped getting generated

I am a newbie to android programming .I was doing tutorial from Commsware tutorial , to be precise T3 tutorial during which I cleaned the project.After that R class file has stopped generating.

I deleted that project,looks like the same error is getting propagated to other new projects I am creating.

This error is coming for the newly created project also.

I tried all the solutions in stackoverflow like : cleaning project,selecting android version in build path , deleting my workspace,freshly install eclipse etc..

The other intimidating thing is my res folder does not show any errors and my xml file does not contain any capital letters.

It must be some silly error which is causing this?

Upvotes: 3

Views: 2818

Answers (3)

Dr. Ben
Dr. Ben

Reputation: 1

There seems to be a problem with the target build settings within your projects.

The R file will not be autogenerated if there is the slightest error in your project. E.g if you use elements in a layout xml file that are available only in Android 2.2 but your project targets android 2.0. Sometimes the offending elements don't show up as errors because, syntax-wise, they are correct.

I advice you look at your target builds in android manifest.

Or target a higher android build (Get the latest one via SDK manager)

Upvotes: 0

cucko
cucko

Reputation: 1436

this happened to me after updating the android dev kit and esclipse. couple of things you should try.

if you updated ADT, you must restart ADB server. you probably haven't read the message that says after update. or maybe restart whole pc.

if you're using external jar files, rename the libs folder to lib and revert it back to libs (from eclipse, f2)

Upvotes: 0

Krauxe
Krauxe

Reputation: 6058

Perhaps you should take a look at this if you've recently updated SDK tools.

After updating to SDK Tools to rev. 22 for the first time, you may need to relaunch Android SDK Manager again and install a new item: Android SDK Build-tools. enter image description here

After installing this, clean your projects and rebuild.

Upvotes: 10

Related Questions