Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio R.java

I'm seeing a crash on an older device that works on multiple newer devices:

android.content.res.Resources$NotFoundException: Resource ID #0x7f030035

If I recall correctly you could look at the R.java to see the culprit, however in Android Studio it doesn't seem to exist. Where is the R.java so I can correlate that ID?

Thanks.

like image 361
Anthony Avatar asked Aug 30 '13 05:08

Anthony


3 Answers

In Android Studio 1.1.0 the R.java file is under

Project/app/build/generated/source/r/debug/com.android.'projectname'/R.java

If you don't see the above collection of folders, clean and build the project first. It takes a few minutes and you'll see Gradle running at the bottom of the IDE.

like image 109
Max West Avatar answered Sep 21 '22 22:09

Max West


In Android Studio 3.4 and above that the R.java file is under

Project/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResourc/r/com/{app package name} / R. java

like image 40
Bhadresh Avatar answered Sep 22 '22 22:09

Bhadresh


[SOLVED] LOCATION OF R.JAVA file in Android Studio 1.3.1 is as follows:

In Android Studio, go to the Project Window (usually on the left-hand side pane:

  1. Right-click on the node, app
  2. Click on "Show In Explorer". This will open the actual directory/location of your project.
  3. The path of the R.java file in this directory is as follows: app\build\generated\source\r\debug\com\sg\calculator
    (Since, I used the package name com.sg.calculator for my project, hence, I had to go inside the folder com\sg\calculator. This will be obviously different for your project).
like image 33
Subhadeep Ghosh Avatar answered Sep 21 '22 22:09

Subhadeep Ghosh