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

前端 未结 9 1722
抹茶落季
抹茶落季 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:28

    Make sure you have a gen folder in your project root. If you don't, make one yourself.

    0 讨论(0)
  • 2021-01-11 21:31

    Fix all errors appear on .xml files. R.java will be re-appeared

    0 讨论(0)
  • 2021-01-11 21:34

    Also make sure to check your imports. Sometimes when your IDE (eclipse & intellij as well) cannot find your generated R class and auto-imports android.R.

    import android.R kills everything you are doing in your generated sources!

    Cost me 30min of my life...

    0 讨论(0)
提交回复
热议问题