What's the easiest way to force Idea to generate the R.Java file?

前端 未结 9 1783
抹茶落季
抹茶落季 2021-01-11 20:43

I am trying to run Android sample applications using intellij idea and R.Java file is missing form notepad samples source directory.

9条回答
  •  独厮守ぢ
    2021-01-11 21:27

    Pay attention that, in current version of IDEA 12, the by-design behaviour is not to generate R.java in the generated sources project directory, but in an IDEA's system directory:

    http://youtrack.jetbrains.com/issue/IDEA-99045

    "It is behaviour of IDEA 12, it doesn't generate full R.java in gen folder, it generates it in the IDEA's system dir during compilation."

    They intend to change this confusing behaviour, but if you're currently working in IDEA 12, look into ~/.IntelliJIdea12\system\compiler\YOUR_PROJECT_NAME.RANDOM_STRING\.generated\aapt\YOUR_PROJECT_NAME.RANDOM_STRING\production\package\R.java for the actual generated source file.

提交回复
热议问题