Android R not regenerating

Recently, I  had to face few strange problems in regenerating R.java file after clean building an Eclipse based Android project. Some of the errors shown in “Error Log” view and “Problems” sections of Eclipse were : 

  • Error executing aapt: Return code -1073741819
  • bin\resources.ap_ does not exist
  • R cannot be resolved to a variable

There were no errors in XMLs or resource files as it should be, when there is a problem with R.java.

Final solution I could come up with was rechecking XML files manually and I noticed below error in main.xml menu file.

<item
android:id=”@+id/action_search”
android:title=”@string/search”
app:showAsAction=”withText|ifRoom”
android:icon=”"/>

As you see above android:icon tag is having empty value which was the reason for all above problems.

Once relevant unwanted parameter was removed everything worked smoothly.  Hence, if Eclipse fails to generate R.java with no marked errors in XMLs or other resource, it is better to check change history and look for any problematic values in XMLs as well. 

 

Share

One comment on “Android R not regenerating

  1. Renaldo April 21, 2014 1:00 AM

    Every weekend i used to pay a quick visit this site, as i want
    enjoyment, since this this web site conations really nice funny stuff too.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>