Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio don't generate R.java for my import project

I import a project to Android Studio , but the R.java is always empty.

public final class R { } 

I have tried:

  1. Make project,make module, remake, etc.
  2. Project Setting-modules-sources, then add src and gen as my source folder.

But they are not take effect.

like image 739
Marshal Chen Avatar asked May 18 '13 09:05

Marshal Chen


People also ask

How is the r file generated in Android Studio?

Android R. java is an auto-generated file by aapt (Android Asset Packaging Tool) that contains resource IDs for all the resources of res/ directory. If you create any component in the activity_main. xml file, id for the corresponding component is automatically created in this file.

What is the role of the R Java file in an Android application project?

What is the role of the R. java file in an Android application project? A. It contains all resource IDs allowing the developer to reference them from the code using integers.


1 Answers

Goto File -> Settings -> Compiler now check use external build

then rebuild project

like image 135
Kuluval Avatar answered Oct 03 '22 08:10

Kuluval