Android An unexpected exception occurred while creating a change object. see the error log for more details

今天再给Android项目工程中的包重命名时出现了这个错误(之前重命名的时候就没有出现,郁闷):An unexpected exception occurred while creating a change object. see the error log for more details

效果如下图所示:

之后google百度各种找,最后在stackoverflow上找到以一个帖子:http://stackoverflow.com/questions/6465127/rename-android-package-name-fails/15771033#15771033     (注意:这个解决办法不是该贴的被采纳的答案)

描述:

  

You can not belive this. I have exactly the same problem and is because I comment a class entirely. So I think that when eclipse try to change the package name of a commented class it throw this error.
To solve the problem you only has to delete the class or uncomment it.

大概的意思就是说,你的项目中的有些类被“全部注释掉了“(整个类中的所有代码都注释掉了,也就是这个类中所有内容都是注释而没有响应的执行代码),找出这些类,并删除他们。我尝试这做了一下,删除之后确实能够重命名了。

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。