3

Recently, I realize Eclipse will not flag any error, if I have duplicated string.xml resource item. It allows me to run the application, or export it as signed APK.

<string name="demo">Demo</string>
..
..
<string name="demo">Pick Me</string>

For the above case, Pick Me will be used.

Is there any technique I can use, to detect such duplicated items before deployment? This is bit scary for delivering wrong message to customer.

4

1 回答 1

3

在日食中:

  1. 打开您的项目属性
  2. 选择 Android Lint 首选项
  3. 确保选择了 DuplicateDefinition 标志。

当您在同一个资源文件中多次定义同一个资源时,这将弹出一个警告。

希望这可以帮助 :)

于 2013-10-10T03:58:55.650 回答