Bug 2257 - Unable to reference a <color> element if its name contains an upper case
Summary: Unable to reference a <color> element if its name contains an upper case
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 2.0
Hardware: PC All
: Normal normal
Target Milestone: 4.16.0
Assignee: Marek Habersack
URL:
: 8706 ()
Depends on:
Blocks:
 
Reported: 2011-11-29 18:07 UTC by Jonathan Pobst
Modified: 2014-08-07 16:21 UTC (History)
7 users (show)

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


Attachments
Test Case (833.77 KB, application/zip)
2011-11-29 18:07 UTC, Jonathan Pobst
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:
VERIFIED FIXED

Description Jonathan Pobst 2011-11-29 18:07:46 UTC
Created attachment 970 [details]
Test Case

From https://bugzilla.novell.com/show_bug.cgi?id=691626.

-- 

Description of Problem:
Cannot build project using 1.0.1 & VC plugin

Steps to reproduce the problem:
1. download attached VC 2010 project
2. add to VC and build


Actual Results:
"aresgen.exe exited with code 1"

Expected Results:
No error message

How often does this happen? 
Every time

Additional Information:
If you remove the uppercase letters in the color element of file theme.axml,
change Main.axml to reference the new name then it will not produce the error.

WORKS    <color name="uicolor_lightgraycolor">#aaaaaa</color>
FAILS    <color name="uicolor_lightGrayColor">#aaaaaa</color>

-- jonp --

I'm not sure how to easily fix this. :-(

The problem is filenames: Android requires lowecase filenames, and some
@color/foo entries are backed by files:

http://developer.android.com/guide/topics/resources/color-list-resource.html

In order to allow MixedCase filenames and resource references (e.g.
@color/MixedCase), aresgen "fixes" XML by lowercasing @color resource
references, so that Android sees @color/mixedcase. This is ~required in order
to support Resources\color\MixedCaseFilename.xml  files.

However, the lowercasing technique thus screws up Resources\values\colors.xml
entries, as you're seeing.

I suppose the fixup process could check for filenames provided, and if a
resource reference isn't also a filename, not lowercase it. I'll need to
investigate that...
Comment 1 Tom Opgenorth 2013-09-26 20:57:09 UTC
Problem still seems to exist. 

The following element will cause a compile error if referenced like android:background="@color/Dim_Gray"
<color name="Dim_Gray">#696969</color>
  


While this one will not (android:background="@color/dim_gray")
<color name="dim_gray">#696969</color>
Comment 2 Radek Doulik 2014-06-05 10:11:23 UTC
*** Bug 8706 has been marked as a duplicate of this bug. ***
Comment 3 Marek Habersack 2014-07-24 12:26:40 UTC
This is now fixed in the Xamarin.Android master branch.
Comment 4 Ram Chandra 2014-08-05 11:40:11 UTC
I have checked this issue now I am not getting any build error when I use <color> element either in upper case or lower case. To verify this issue I have create two elements i.e. 

	<color name="uicolor_lightGrayColor">#aaaaaa</color>
        <color name="uicolor_lightgraycolor">#cccccc</color>

and both elements are working fine with following attribute        

      android:background="@color/uicolor_lightgraycolor"
       android:background="@color/uicolor_lightGrayColor".

This issue has been fixed. Hence, I am closing this issue.

Environment Info :

=== Xamarin Studio ===

Version 5.3 (build 412)
Installation UUID: 3dbf10c4-ed30-4e55-8a8b-1704777c7b5f
Runtime:
	Mono 3.8.0 ((no/9ffca33)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 308000002

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.Mac ===

Version: 1.10.0.4 (Enterprise Edition)

=== Xamarin.iOS ===

Version: 7.2.6.28 (Enterprise Edition)
Hash: 606f31a
Branch: 
Build date: 2014-08-01 15:27:48-0400

=== Xamarin.Android ===

Version: 4.16.0 (Enterprise Edition)
Android SDK: /Users/apprpject/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Build Information ===

Release ID: 503000412
Git revision: 77e042831804079a649ee83092ed36c7c10773a2
Build date: 2014-08-01 06:32:22-04
Xamarin addins: 57e379e6a9454a1c0d97aa3f770e7ae7cc16c522

=== Operating System ===

Mac OS X 10.8.5
Darwin localhost 12.5.0 Darwin Kernel Version 12.5.0
    Sun Sep 29 13:33:47 PDT 2013
    root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64