R.Java not generated

后端 未结 11 1863
独厮守ぢ
独厮守ぢ 2020-12-19 03:27

I have downloaded code from google codes but when I import that project in my eclipse IDE it does not generate R.Java file.I searched many blogs and forums and tried many th

11条回答
  •  时光说笑
    2020-12-19 04:11

    In general, to make it work:

    1. import project into eclipse (File -> Import -> General -> Existing Projects into Workspace)
    2. in Eclipse, Manually create gen folder and add it as source folder (right click on your project, Build Path -> Configure Build Path -> Add folder)
    3. Clean your project, you suppose to get R.java generated

    But It doesn't, Why?

    Because there are some compile error (or bug?) regarding to the xml file in res, so R is not genetared (I've tested on my Mac):
    In res/values/styles.xml: commented out the following:

    
    

    In res/values/themes.xml: comment out the following:

    @style/iWindowTitleBackground
    

    Then do a Project -> Clean, you should get R.java generated.

    There is bug reported that parent="android:WindowTitleBackground" cannot be resolved in some operating system, check out here for more details.

提交回复
热议问题