Bug 9861 - Wrong filename provided for Android Resources containing errors
Summary: Wrong filename provided for Android Resources containing errors
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.5.x
Hardware: PC Mac OS
: Normal enhancement
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2013-01-29 16:27 UTC by Jonathan Pryor
Modified: 2017-07-06 15:58 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jonathan Pryor 2013-01-29 16:27:17 UTC
Context: http://forums.xamarin.com/discussion/978/build-error-points-to-main-xml-instead-of-main-axml#latest

When an error is found within an Android Resources, the wrong filename is used in the error message.

To reproduce:

1. Create a default template project.
2. Edit the Resources\Layout\Main.axml file, AS SOURCE (not the GUI editor)
3. Change the //Button/@android:text attribute to refer to an invalid string resource name, e.g.


4. Build

Expected result:

The error message should state that the error is in Resources\Layout\Main.axml.

Actual result:

    Error: Tool exited with code: 1. Output: obj/Debug/res/layout/main.xml:1: error:
    Error: No resource found that matches the given name (at 'text' with value '@string/hello__').

Note two things:

1. The path is wrong
2. The error output isn't in a "parseable" form. Consequently when double-clicking on the error the .targets file will be opened, instead of the relevant file.
Comment 2 Prashant [MSFT] 2017-07-04 07:19:17 UTC
I don't see this issue in the latest 15.2 release.
The error reported as expected
Comment 3 Prashant [MSFT] 2017-07-06 15:58:27 UTC
In the latest version of Xamarin.Android tools the file name in the error message reported as expected

Resources/layout/Main.axml(2): error APT0000:  Error: No resource found that matches the given name (at 'text' with value '@string/hello__').

Full build log -