R.java disappears after project clean

前端 未结 30 2010
傲寒
傲寒 2020-11-30 05:37

After I added some .png files into my Project Workspace drawable folder I refreshed my drawable folders in Eclipse and the newly added files showed up. But when I tried to a

相关标签:
30条回答
  • 2020-11-30 06:17

    I would agree this is usually a XML problem but moreover that it is something within your res folder that is the problem and may be highlighted with a red cross after the clean attempt.

    I have just had this problem and it was because I had created my own folder called 'data' within res folder. After the clean it had a little red cross against it. I removed this folder and R built again.

    Regards, Mark

    0 讨论(0)
  • 2020-11-30 06:18

    Here is what the problem was. I added those new png images to the project and android has rules as to what characters are allowed in the names of these images. Once I changed the uppercase letters in the image name, it was back on track again and Build Automatically generated the R.java file and all errors were gone. Eclipse console is the place where I found all the errors related to my resources.

    Thanks Guys....I tried your solutions but my error was something specific which was due to my image naming convention so this is the way I fixed it.

    0 讨论(0)
  • 2020-11-30 06:18

    I had an invalid jpg in my res/drawable folder. I removed the jpg and it worked.

    0 讨论(0)
  • 2020-11-30 06:19

    I had the same problem when I cleaned my project. I got crazy to solve it, I searched and searched but solved it in my way. First of all, delete all needless files in your /res folder. I had some notes in it, I took them to another project that I don't work on it and build the project manually. It worked! Try this I'm sure it will help.

    Good developing!

    0 讨论(0)
  • 2020-11-30 06:19

    Try Project -> check Build Automatically

    0 讨论(0)
  • 2020-11-30 06:20

    Check at the Console View If there in message Error, It will Help you to find out the source of the probleme. I had i similar probleme and i find out that the probleme was from the pic name even if the name respect the Syntax so I change it to img1 and it worked fine.

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