Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

duplicate string resource in strings.xml android

Tags:

android

xml

Are there other ways to check for duplicate string resource in Android?

say I have these 2 strings:

<!-- some other strings -->
<string name="A">I'm A</string>
<string name="A">I'm A</string>
<!-- some other strings -->

In my Eclipse, this doesn't cause any error or warnings, even if I tried using lint it does not show up. How can I see such problems then?

like image 483
kishidp Avatar asked Oct 15 '13 06:10

kishidp


Video Answer


1 Answers

In eclipse:

  1. Open your project properties
  2. Select Android Lint Preferences
  3. Make sure the DuplicateDefinition flag is selected.

This will pop up a warning each time you have a duplicate resource in one of your resource files.

Hope this helps :)

like image 51
Gil Moshayof Avatar answered Oct 03 '22 05:10

Gil Moshayof