Bug 23034 - Resource files copied to obj directory lose Case causing resource compilation errors
Summary: Resource files copied to obj directory lose Case causing resource compilation...
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.16.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2014-09-15 22:53 UTC by Paul
Modified: 2017-06-27 19:38 UTC (History)
3 users (show)

Tags:
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:
Status:
RESOLVED INVALID

Description Paul 2014-09-15 22:53:41 UTC
This applies to Alpha version (Xamarin Studio: Version 5.4 (build 194)).

When using original resources (drawables, layouts, styles and attributes) with Capitals (regardless of placement), they lose the original case once copied to obj directory. This causes the resources to fail upon compilation with error:

Error: No resource found that matches the given name (at XXX with value YYY). 

It looks like previously the resource compilation did not respect the case, but now it does. 

I recall there was a similar problem on iOS alpha channel, but it was fixed.
Comment 1 Rajneesh Kumar 2014-09-16 04:02:30 UTC
I try to reproduce this issue and but not able to reproduce. To reproduce this issue I used helped provided in bud description.

Steps I followed:
1. Create android application
2. Observed that there are three folders under 'Resources' named (drawable, layout, values)
3. Rename folder 'drawable' with 'DRAWABLES', then try to build getting following error:

"C:\Users\Admin\Documents\Projects\rtrtrtrt\rtrtrtrt\aapt.exe:
 Error: Invalid resource directory name: "drawables". (rtrtrtrt)"

Is this the same experience facing you? If no, could you please provide us proper steps to reproduce this issue, that will be useful to reproduce this issue at our end.

Please let me know if I am missing anything.

Screencast: http://screencast.com/t/k5TpLKKTbHn

Environment Info:

=== Xamarin Studio ===

Version 5.3 (build 441)
Installation UUID: 3b924754-5196-440a-b42b-05ebb3a3082e
Runtime:
	Microsoft .NET 4.0.30319.18408
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.26

=== Xamarin.Android ===

Version: 4.16.0 (Business Edition)
Android SDK: D:\Android\android-sdk
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		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)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: C:\Program Files\Java\jdk1.6.0_31
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)

=== Build Information ===

Release ID: 503000441
Git revision: befb6aa1176d37a5f678f4274f340a0159091b7a
Build date: 2014-09-08 20:54:12-04
Xamarin addins: 6dc7c388e31fdfc8014689839d37de0d4622435c

=== Operating System ===

Windows 6.1.7601.65536
Comment 2 Paul 2014-09-16 19:55:14 UTC
Sorry about that. The case is lost in the resource files, not the folder names. Imagine the original file MyLogo.png. When it is copied to obj/project/res/drawable it becomes mylogo.png. 

When compiling a layout with reference to this drawable:

<
...
android:background="@drawable/MyLogo"
...
/>

it produces the error

Error: No resource found that matches the given name.


Another problem is with attributes.

Previously I had my custom colour declared in styles.xml:

<color name="greylabel">#ffc3c3c3</color>

And several views used it like this:

android:textColor="@color/GreyLabel"

And it never produced an error related to case. Now it does. 	



Please provide the understanding whether it is deliberate change or a bug.
Comment 3 Rajneesh Kumar 2014-10-09 11:26:19 UTC
As per comment 2

I can reproduce the reported behavior.

But only in case of: Another problem is with attributes

<color name="greylabel">#ffc3c3c3</color>
And several views used it like this:
android:textColor="@color/GreyLabel"

Steps to reproduce:

1. Create an android application 
2. Open Strings.xml and add following code:
   <color name="greylabel">#AB2727</color>
3. Open Main.xaml and drag a text view on it and write some text
4. Go to source view and add following code in <TextView..../>
  android:textColor="@color/greylabel"
5.Run the application observe that the text color changed
6.Now in <TextView.../> write GreyLabel in place of greylabel
7. Build the application and observe the following error:
  "Error: No resource found that matches the given name (at 'textColor' with value '@color/GreyLabel'). (Bug_23034)"

Screencast: http://www.screencast.com/t/5OIJPHVg0Tp

Environment Info:
=== Xamarin Studio ===

Version 5.5 (build 227)
Installation UUID: a7e29e93-6348-4126-9ebc-b2777c96a552
Runtime:
	Microsoft .NET 4.0.30319.18408
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.26

=== Xamarin.Android ===

Version: 4.18.0 (Business Edition)
Android SDK: E:\android-sdk
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode)

=== Build Information ===

Release ID: 505000227
Git revision: 7b721eeec7a2fa4c4f4de0ecd2aed4dc25edac95
Build date: 2014-10-02 15:51:22-04
Xamarin addins: 99ed56b428b31eba1efaace4d82188d6f334e6ca

=== Operating System ===

Windows 6.2.9200.0 (64-bit)
Comment 4 Chris Hardy [MSFT] 2017-06-27 19:38:18 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Android. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.