10

I'm kind of new to developing and in the code I am working on now R.java won't generate. I haven't imported android.R anywhere, build automatically is turned on, and I have tried cleaning the project several times. I read that any errors in any of your XML files will keep R from generating and I only have one and it says "The prefix "xliff" for element "xliff:g" is not bound" Here is the section of cade where that is. The error is on line 22 where it first says "xliff" but is not there on line 28 where it has the same thing:

    <?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<string name="app_name">Alarm Clock</string>
<string name="app_label">Alarm Clock</string>
<string name="add_alarm">Add alarm</string>
<string name="delete_alarm">Delete Alarm</string>
<string name="enable_alarm">Enable alarm</string>
<string name="disable_alarm">Disable Alarm</string>
<string name="delete_alarm_confirm">This alarm will be deleted.</string>
<string name="show_clock">Show Clock</string>
<string name="hide_clock">Hide clock</string>
<string name="label">Label</string>
<string name="default_label">Alarm</string>
<string name="set_alarm">Set alarm</string>
<string name="alarm_vibrate">Vibrate</string>
<string name="alarm_repeat">Repeat</string>
<string name="alert">Ringtone</string>
<string name="time">Time</string>
<string name="alarm_alert_dismiss_text">Dismiss</string>
<string name="alarm_alert_alert_silenced">
    Alarm silenced after
    <xliff:g id="minutes">%d</xliff:g>
    minutes
</string>
<string name="alarm_alert_snooze_text">Snooze</string>
<string name="alarm_alert_snooze_set">
    Snoozing for 
    <xliff:g id="minutes">%d</xliff:g> 
    minutes.
</string>
user1185205
  • 123
  • 1
  • 6
  • Sometimes all errors won't show up in the xml, if you remove the first tag, you'll see that the error moves to the next one. – Jave Feb 02 '12 at 13:33

1 Answers1

24

Think you need to declare the namespace in the opening tag...

AFAICT, you need to change

<resources xmlns:android="http://schemas.android.com/apk/res/android">

to

<resources xmlns:android="http://schemas.android.com/apk/res/android"
           xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
tim_yates
  • 167,322
  • 27
  • 342
  • 338
  • See this post for more details: http://stackoverflow.com/questions/6158157/what-does-this-mean-xmlnsxliff-xml – E-Riz Feb 02 '12 at 16:39
  • Thanks this fixed that problem but once it did another one showed up. the error says "error: Error: No resource found that matches the given name (at 'resource' with value '@xml/analog_appwidget')" I have analog_appwidget.xml in my layout folder though. ` ` – user1185205 Feb 06 '12 at 13:03