当前位置: 动力学知识库 > 问答 > 编程问答 >

android - strings.xml:17: error: Error parsing XML: unbound prefix

问题描述:

It initially had no errors. But showing errors without markers ever since I tried to sign and export it.

I checked many possible solutions on the net but none have worked. Please help.

<?xml version="1.0" encoding="utf-8"?>

<resources

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

tools:ignore="MissingTranslation"

>

<!-- Label for the "Done" button on the far left of action mode toolbars. -->

<string name="abc_action_mode_done" translatable="false">Done</string>

<!-- Content description for the action bar "home" affordance. [CHAR LIMIT=NONE] -->

<string name="abc_action_bar_home_description" translatable="false">Navigate home</string>

<!-- Content description for the action bar "up" affordance. [CHAR LIMIT=NONE] -->

<string name="abc_action_bar_up_description" translatable="false">Navigate up</string>

<!-- Content description for the action menu overflow button. [CHAR LIMIT=NONE] -->

<string name="abc_action_menu_overflow_description" translatable="false">More options</string>

<!-- Content description for the Toolbar icon used to collapse an expanded action mode. [CHAR LIMIT=NONE] -->

<string name="abc_toolbar_collapse_description" translatable="false">Collapse</string>

<!-- Formatting string for describing the action bar's title/home/up affordance.

This is a single tappable "button" that includes the app icon, the Up indicator

(usually a "<" chevron) and the window title text.

%1$s is the title. %2$s is the description of what tapping/clicking the whole

thing is going to do. -->

<string name="abc_action_bar_home_description_format" translatable="false">%1$s, %2$s</string>

<!-- Just like action_bar_home_description_format, but this one will be used

if the window is also providing subtitle text.

%1$s is the title. %2$s is the subtitle. %3$s is the description of what

tapping/clicking the whole thing is going to do. -->

<string name="abc_action_bar_home_subtitle_description_format" translatable="false">%1$s, %2$s, %3$s</string>

<!-- SearchView accessibility description for search button [CHAR LIMIT=NONE] -->

<string name="abc_searchview_description_search" translatable="false">Search</string>

<!-- SearchView accessibility description for search text field [CHAR LIMIT=NONE] -->

<string name="abc_searchview_description_query" translatable="false">Search query</string>

<!-- SearchView accessibility description for clear button [CHAR LIMIT=NONE] -->

<string name="abc_searchview_description_clear" translatable="false">Clear query</string>

<!-- SearchView accessibility description for submit button [CHAR LIMIT=NONE] -->

<string name="abc_searchview_description_submit" translatable="false">Submit query</string>

<!-- SearchView accessibility description for voice button [CHAR LIMIT=NONE] -->

<string name="abc_searchview_description_voice" translatable="false">Voice search</string>

<!-- ActivityChooserView - accessibility support -->

<!-- Description of the shwoing of a popup window with activities to choose from. [CHAR LIMIT=NONE] -->

<string name="abc_activitychooserview_choose_application">Choose an app</string>

<!-- Title for a button to expand the list of activities in ActivityChooserView [CHAR LIMIT=25] -->

<string name="abc_activity_chooser_view_see_all">See all</string>

<!-- Description of a share target (both in the list of such or the default share button) in a ShareActionProvider (share UI). [CHAR LIMIT=NONE] -->

<string name="abc_shareactionprovider_share_with_application">Share with %s</string>

<!-- Description of the choose target button in a ShareActionProvider (share UI). [CHAR LIMIT=NONE] -->

<string name="abc_shareactionprovider_share_with">Share with</string>

The errors:

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_action_bar_home_description' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_action_bar_home_description_format' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_action_bar_home_subtitle_description_format' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_action_bar_up_description' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_action_menu_overflow_description' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_action_mode_done' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_activity_chooser_view_see_all' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_activitychooserview_choose_application' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_searchview_description_clear' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_searchview_description_query' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_searchview_description_search' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_searchview_description_submit' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_searchview_description_voice' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_shareactionprovider_share_with' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] warning: string 'abc_shareactionprovider_share_with_application' has no default translation.

[2015-03-05 01:32:31 - GEEKONIX] F:\Edge15\appcompat_v7\res\values\strings.xml:17: error: Error parsing XML: unbound prefix

[2015-03-05 01:32:31 - GEEKONIX]

网友答案:

go to preferences and ignore lint errors by changing them to fatal to ignore and then clean the project will work ...

because it is giving you error you are not able to generate R.java because of which all your resources are unallocated

网友答案:

Either remove tools:ignore="MissingTranslation" from the root element or add xmlns:tools="http://schemas.android.com/tools" to the root element. Your tools prefix is undefined at the moment.

网友答案:

Somehow while trying to sign the app eclipse removed this line from most xml files.

xml version="1.0" encoding="utf-8"

On adding back this line to the xml files the project worked again

分享给朋友:
您可能感兴趣的文章:
随机阅读: