读书人

导入一个android项目报错的解决方法

发布时间: 2012-06-28 15:20:04 作者: rapoo

导入一个android项目报错的解决办法
一、可能是设置不对,选择菜单window>preferences弹出对话框
1.单击Android,设置android-sdk的安装目录
2.单击java>installed jres,添加jdk的安装目录

二、可能是string.xml中的含有百分号%导致整个项目都是红叉:
Multiple annotations found at this line:
  - error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false"attribute?
  - error: Unexpected end tag string
- error: Unexpected end tag string
有两个办法可供选择
  1.用%%来表示1个%,和转意符号 \ 的用法相同
  2.如果你的字符串不需要格式化,可以在你的<string 标签上增加一个属性:formatted="false"例如 <string name="test" formatted="false">%test%</string> 即可。

修改之后,单击选中项目,然后选择菜单project下的clean...ok

三、运行时报错
Re-installation failed due to different application signatures.
Poc]Please execute 'adb uninstall com.ims.poc.ui' in a shell.
解决方法:在模拟器中选择settings〉application manage〉uninstall

读书人网 >Android

热点推荐