简体   繁体   English

Eclipse崩溃且未重新生成R.java

[英]Eclipse Crash and Not Regenerate R.java

I know this question has been asked & answered before. 我知道这个问题以前曾被问过和回答过。 But, none of those answers work for me. 但是,这些答案都不适合我。 Eclipse crashed in the middle of a build and keeps erasing the R.java file. Eclipse在构建过程中崩溃,并不断擦除R.java文件。 I have tried to clean and rebuild. 我已尝试清洁和重建。 Does not help. 没有帮助。 I was using SDK build tools 19.0 upgraded to 20.0. 我使用的SDK开发工具从19.0升级到20.0。 Does not help. 没有帮助。 I didn't touch anything in the XML files and I do not see any errors in the XML files. 我没有触摸XML文件中的任何内容,也没有看到XML文件中的任何错误。

尝试另一个IDE,例如Idea ,检查这是否是由于Eclipse故障而不是您最近更新的SDK引起的

I my case there was something wrong with my XML usually my layout files, when you have a problem in your XML files the clean option does not work properly, check your XML files ( layout and manifest ) and after that clean your project. 以我为例,我的XML通常是layout文件有问题,当您的XML文件有问题时,clean选项无法正常工作,请检查XML文件( layoutmanifest ),然后清理您的项目。

Hope this help you 希望这对您有帮助

I did get my R.java back. 我确实恢复了R.java。 There was a jpeg for another project stuck in a drawable directory. 在可绘制目录中存在另一个项目的jpeg。 Don't know how it got there. 不知道它是怎么到达那里的。 and, still lots of unexplained errors though. 并且,仍然有许多无法解释的错误。

All my other errors were from switch statements using R.something_menu.icon for cases handling user responses. 我所有其他错误均来自使用R.something_menu.icon的switch语句,用于处理用户响应的案例。 I got a message that as of ADT 14, switch statements can no longer be used. 我收到一条消息,从ADT 14开始,不再可以使用switch语句。 I had to migrate to if...else It works. 我必须迁移到...,否则它可以工作。 Don't know why. 不知道为什么。 But, it solved the problem & saved my code. 但是,它解决了问题并保存了我的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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