Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot resolve Symbol R, where is gen folder in Android Studio?

I have created a dummy Android project from within Android studio, and I can make it run, but the Editor itself fails to find the R class. In fact I can't find the gen folder. I thought that maybe that folder should be added as a source folder or a classes dependency, but I just can't find it.

Can anyone help?

like image 960
Luis Muñiz Avatar asked May 18 '13 11:05

Luis Muñiz


People also ask

What is Gen folder in Android Studio?

gen/ folder holds source code that Android's build tools generate.

Where is the R Java file in Android Studio?

R. java is the generated file by ADT or Android studio. It will be located under app\build\generated\source\r directory.

What is r in Android Studio?

R is a class containing the definitions for all resources of a particular application package. It is in the namespace of the application package. For example, if you say in your manifest your package name is com. foo. bar , an R class is generated with the symbols of all your resources in com.


1 Answers

@joe_deniable gave me the idea to look closer in the build folder, and I found a folder that had been excluded by intellij, where my R was happily having an ice cream. This was here:

build/source/aidl/debug

I had to remove this folder from the exclusion list and add it to the sources, and could finally start coding in this new IDE.

Thanks

like image 118
Luis Muñiz Avatar answered Oct 24 '22 00:10

Luis Muñiz