I import a project to Android Studio , but the R.java is always empty.
public final class R {
}
I have tried:
I failed even if I tried to update the SDK tools as mentioned here.
Here is how I solved the problem (for the library projects imported).
In File -> Project Structure -> Modules, I removed the problematic projects, and added them again by selecting New Module -> Android Library Module.

After rebuilding the project, I got all the R.java files back.