简体   繁体   中英

R.java gives an error

My R.java gives an error

public static final int 1405308882_more = 0x7f020000

Don't know or understand why its giving this error, i regenerate the R.java file and it still gives me the following above. and when i hover my mouse over it, it says

underscore have to be located within digits

I tried editing it but when it compiles it still regenerate the same name variable.

Please before anyone starts rating this question as usless take your time to understand it I don't have error in any of my java files either in the src folder or layout folder every thing else is fine its just the R.java that generates that constant so please understand before you jump to conclusions. Thank you.

There might be some thing error in your res folder once check each and every file and clean your project once and refresh it again..

Sounds like the R.java file has not updated, try some of these general pointers to begin with:

  • Do not manually edit any of the files in the gen folder, as these are automatically built for you.
  • If you find it is out of sync then try refreshing the project.
  • If that did not work try a clean (project -> clean)
  • If that did not work delete the gen folder, from within Eclipse, (do not panic) it will then be rebuilt by Eclipse - however if there is a coding error of some sort it may not do this straight away.

Hope this helps..

It wasn't the XML file that was the issue. It was an image in the resource folder with a name that didn't follow the standard naming rules and thus made the R.java to generate that error.

它重新生成的原因是相同的,因为它是从代码中重新生成的,因此您应该检查该项目的.xml文件,问题可能出在其中1个文件上,尝试清除已创建的xml,然后重新生成它。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM