Bug 17522 - Incorrect location for resource errors
Summary: Incorrect location for resource errors
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.10.1
Hardware: PC Mac OS
: High enhancement
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2014-01-30 17:11 UTC by Mikayla Hutchinson [MSFT]
Modified: 2017-06-28 18:24 UTC (History)
3 users (show)

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


Attachments
Sample project that shows the error message from a missing resource. (29.10 KB, application/zip)
2017-06-28 18:24 UTC, Tom Opgenorth
Details


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:
Status:
RESOLVED FIXED

Description Mikayla Hutchinson [MSFT] 2014-01-30 17:11:24 UTC
If an axml file references missing resources, the build outputs all the aapt errors as a giant blob of error string with the location as the targets file.

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Tool exited with code: 1. Output: obj/Debug/res/layout/foo.xml:1: error: Error: No resource found that matches the given name (at 'hint' with value '@string/tbFirst_Hint').
obj/Debug/res/layout/foo.xml:1: error: Error: No resource found that matches the given name (at 'layout_margin' with value '@dimen/defMargin').
 (AndroidTest)


The build should parse the file, line and error info from this blob and output individual errors with useful location information and error codes e.g.

Resources\foo.axml(1) : error XA1234: No resource found that matches the given name (at 'hint' with value '@string/tbFirst_Hint').

Resources\foo.axml(1) : error XA1234: No resource found that matches the given name (at 'layout_margin' with value '@dimen/defMargin').
Comment 1 Tom Opgenorth 2017-06-28 18:22:24 UTC
I believe that changes in Visual Studio for Mac & the Android designer have addressed this issue. Visual Studio for Mac produces the following error when trying to compile an Android layout that is missing a resource: 

Resources/layout/Main.axml(2): error APT0000:  Error: No resource found that matches the given name (at 'text' with value '@string/helloworldtext').
Comment 2 Tom Opgenorth 2017-06-28 18:24:00 UTC
Created attachment 23181 [details]
Sample project that shows the error message from a missing resource.