Brent Hronik
Brent Hronik

Reputation: 2427

R.java not generated after update

My generation of R.java is non-existent, but my BuildConfig.java is still generated when projects are rebuilt. This problem is not localized to a single project in my workspace, but to the entire workspace which has projects in ranging from gingerbread to jb, all of which exhibit this error. I have been working with the Android platform for over a year now, and the R.java generation has always been a little mystical, but would always seem to fix itself with a restart of eclipse or a rebuild of the project.

This started when I ran a java update to java 7, so did a changed back to the java 6 sdk, specifically 1.6.0_26, did a fresh install of eclipse(4.2), the android sdk and adt, but to no effect.

I am working on this project with other group members(working off of the same master git repo), and they are not having problems with R.java generating, so therefore I can say for certainty that there are no errors in files causing the R.java to not generate.

And as a disclaimer, yes I have read the plethora of material on here with R.java related issues.

Any suggestions? Thanks

Upvotes: 0

Views: 3217

Answers (3)

Siklab.ph
Siklab.ph

Reputation: 1021

I encountered this with the latest update. Deleting then re-importing the project to my workspace fixed it.

Upvotes: 0

dtk
dtk

Reputation: 2526

I had the exact same symptoms.

Problem

  • R.java not getting build across the workspace, resulting in an error when trying to import it:

    The import <tld>.<project>.R cannot be resolved

  • The error reporting that the version of adb could not be determined despite existing:

    Failed to get the adb version: Cannot run program "/home/dtk/.opt/android-sdk-linux/platform-tools/adb": java.io.IOException: error=2, No such file or directory from '/home/dtk/.opt/android-sdk-linux/platform-tools/adb' - exists=true`
    dtk@humbee ~/.opt/android-sdk-linux/platform-tools % ll | grep adb
    -rwxr-xr-x 1 dtk dtk 200K Sep 12 14:41 adb*
    dtk@humbee ~/.opt/android-sdk-linux/platform-tools % file adb
    adb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped
    dtk@humbee ~/.opt/android-sdk-linux/platform-tools % ./adb
    zsh: no such file or directory: ./adb
    127 dtk@humbee ~/.opt/android-sdk-linux/platform-tools %

Solution

Installing ia32-libs fixed it for me:

root@humbee:~# uname -m
x86_64
root@humbee:~# aptitude search ia32-libs
p   ia32-libs                                                                                                     - ia32 shared libraries for use on amd64 and ia64 systems                                                                 
p   ia32-libs-dev                                                                                                 - ia32 development files for use on amd64 and ia64 systems                                                                
p   ia32-libs-gtk                                                                                                 - GTK+ ia32 shared libraries                                                                                              
v   ia32-libs-static                                                                                              -                                                                                                                         
root@humbee:~# aptitude install ia32-libs
The following NEW packages will be installed:
  ia32-libs lib32asound2 lib32bz2-1.0 lib32gcc1 lib32ncurses5 lib32stdc++6 lib32tinfo5{a} lib32v4l-0 lib32z1 libc6-i386{a} 
    [...]
dtk@humbee ~/.opt/android-sdk-linux/platform-tools % ./adb version
Android Debug Bridge version 1.0.29
dtk@humbee ~/.opt/android-sdk-linux/platform-tools % 

HTH, dtk

Upvotes: 2

AlexN
AlexN

Reputation: 2554

If you are using Eclipse, I would recommend to turn-on extended logging, it should display AAPT output, when AAPT is a tool for generating R.java.

To make this - go to Window->Preference->Android->Build and set BuildOutput to Verbose. When you are done - make a clean build and pay a highest attention on COnsoleOutput tab in Eclipse. Every warning or message can guide you to the error.

Let us know if you'll notice something interesting.

Good luck

Upvotes: 0

Related Questions