Android 工程重命名错误

关键字:Android Rename, Android Package Name


今天在对一个安卓工程重命名时,遇到了下面的错误:

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

复制代码

各种百度,Google之后,发现下面的结论:

  1. 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.
  2. To solve the problem you only has to delete the class or uncomment it.

复制代码

大意是说,工程中有注释的类,将其找出,删除或者解注释即可。


本来,到这里,应该告一段落,但是,我在删除了工程中,注释掉的类以后,还是有这个错误。

也许还有漏网之鱼,还有其它被注释掉的类没有找出来。


同事提供了另外一种有效的方式:

1.修改AndroidManifest.xml中的包名。

2.在工程中的src目录下,找到和App的包名一致的包,点右键,选择Refactor->Rename..然后把包名改成自己想要的包名。

3.如果有编译错误,比如布局文件xml中有错,按照提示修改错误就OK了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值