How to generate R.java

后端 未结 11 1511
花落未央
花落未央 2020-12-10 03:57

I downloaded few source codes from Google source codes.

I executed them on Eclipse but R.java file is not created and therefore I got many errors saying

相关标签:
11条回答
  • 2020-12-10 04:28

    Cleaning the project, delete the R.java and regenerate it. If you have an error anywhere in your /res file (the resources) , the R will not be generated usually. It could be an error in the name of a picture , or anything ... fix your errors before. good luck ;)

    0 讨论(0)
  • 2020-12-10 04:29

    I encountered this issue after adding a jpg file with a numeric file name into my drawable folder. I was getting a compilation error, " expected on line y" when trying to rebuild the project after cleaning it. You may want to check that you do not have a similar issue. Although I encountered this while using Android Studio, I am sure it would affect Eclipse as well.

    0 讨论(0)
  • 2020-12-10 04:30

    For future readers, restart adb then clean.

    0 讨论(0)
  • 2020-12-10 04:31

    After few hours frustration finally I have decide to remove the red marks from the my file where it was not able to resolve the R.java as it was not actually available in my code. After removing the first red line from my activity file the project builds and generated the R.java automatically.

    This is something really freaking thing for me as it goes without any reason and came back with the same thing.

    Hope this will help you

    Kind Regards, Summved

    0 讨论(0)
  • 2020-12-10 04:34

    I have encountered similar problem and i changed the workspace folder and all errors disappeared. It's sort of simple solution but it works.

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