Bug 23217 - Resource strings not being picked up in the designer
Summary: Resource strings not being picked up in the designer
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Android Designer ()
Version: 5.5
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Jérémie Laval
URL:
Depends on:
Blocks:
 
Reported: 2014-09-20 13:14 UTC by Paul Johnson
Modified: 2015-02-18 17:20 UTC (History)
2 users (show)

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


Attachments
Screenshot showing nothing in project resources (52.03 KB, image/tiff)
2014-09-20 13:14 UTC, Paul Johnson
Details
designer showing nothing for AddAnimal.Type (137.57 KB, image/tiff)
2015-02-18 07:15 UTC, Paul Johnson
Details
Screen shot of the string editor from XS (147.75 KB, image/tiff)
2015-02-18 07:15 UTC, Paul Johnson
Details
Project strings.xml file. No build errors show with this file (132.13 KB, text/xml)
2015-02-18 07:16 UTC, Paul Johnson
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 Paul Johnson 2014-09-20 13:14:22 UTC
Created attachment 8135 [details]
Screenshot showing nothing in project resources

I have a TextView, to add a string, I select the Text property but nothing is showing in the strings selector window (see screenshot attached)

=== Xamarin Studio ===

Version 5.5 (build 198)
Installation UUID: f3d1a29c-1ba2-4a83-a193-1087efe91a85
Runtime:
	Mono 3.10.0 ((detached/ac51002)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000016

=== Apple Developer Tools ===

Xcode 6.0 (6299)
Build 6A313

=== Xamarin.iOS ===

Version: 8.2.0.176 (Enterprise Edition)
Hash: 973f8d4
Branch: 
Build date: 2014-09-17 17:40:20-0400

=== Xamarin.Android ===

Version: 4.18.0.30 (Enterprise Edition)
Android SDK: /Users/PFJ/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		1.6    (API level 4)
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.0    (API level 11)
		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)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)

=== Xamarin.Mac ===

Version: 1.11.0.1 (Enterprise Edition)

=== Build Information ===

Release ID: 505000198
Git revision: 7495942eb76d6b80c460ddd61f2b94cba1a97fa2
Build date: 2014-09-18 09:50:12-04
Xamarin addins: c571b625445d60f2c8b189b309a6ffc87386caed

=== Operating System ===

Mac OS X 10.10.0
Darwin Pauls-iMac.local 14.0.0 Darwin Kernel Version 14.0.0
    Sun Sep  7 19:47:26 PDT 2014
    root:xnu-2782.1.96~4/RELEASE_X86_64 x86_64
Comment 1 Udham Singh 2014-09-22 09:41:45 UTC
I have tried to reproduce this issue but not able to reproduce this. To reproduce this issue I have followed the steps mentioned below : 

1. Create a simple android application.
2. Open 'Main.axml' file in designer mode.
3. Add a control 'TextView' on the android designer.
4. Click on the added 'TextView' control and open properties window.
5. Select the 'Text' properties, it will open a window named 'Resources' and it will show the required info.

Screencast : http://www.screencast.com/t/33hI7889VGp

Please let me know if I missed anything.

Environment Info :

=== Xamarin Studio ===

Version 5.5 (build 198)
Installation UUID: ce927b2a-2c07-44c5-b186-09cfdafba6dc
Runtime:
	Mono 3.8.0 ((no/45d0ba1)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 308000009

=== Apple Developer Tools ===

Xcode 6.0.1 (6528)
Build 6A317

=== Xamarin.Android ===

Version: 4.18.0.30 (Business Edition)
Android SDK: /Users/xamarin76/Desktop/android-sdk-macosx
	Supported Android versions:
		1.6    (API level 4)
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.0    (API level 11)
		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)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Build Information ===

Release ID: 505000198
Git revision: 7495942eb76d6b80c460ddd61f2b94cba1a97fa2
Build date: 2014-09-18 09:50:12-04
Xamarin addins: c571b625445d60f2c8b189b309a6ffc87386caed

=== Operating System ===

Mac OS X 10.9.4
Darwin Xamarin76s-Mac-mini.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 2 Paul Johnson 2015-01-15 16:51:46 UTC
The names tend to not be picked up in there is a period in the name part

For example

<string name="foo.bar.something">Hello world</string>

may not always be picked up
Comment 3 Udham Singh 2015-01-16 05:38:08 UTC
Thanks Paul,

I have tried to reproduce this issue again but still not able to reproduce this. 

Screencast : http://www.screencast.com/t/mpy5f7mWIa

Could you please check this issue again with latest stable xamarin builds? And let us know if you are still getting this issue along with Ide Logs and Android Tools Log, so that developer can figure out what's going on from the stack trace.

You can get above logs via 'XS > Help > Open Log Directory and get the latest Ide logs and Android Tools Log'.

Thanks!

Environment Info : 

Mac OS X 10.9.5
Xamarin Studio  5.7 (build 661)
Mono 3.12.0 ((detached/1538a59)
GTK+ 2.24.23 (Raleigh theme)
Xcode 6.1.1 (6611)
Xamarin.Android 4.20.0.28 (Enterprise Edition)

=== Build Information ===

Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 16:31:31-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7
Comment 4 Paul Johnson 2015-02-18 07:14:34 UTC
Tested against the latest stable and alpha and I get the same result - the attached files show what I'm seeing
Comment 5 Paul Johnson 2015-02-18 07:15:18 UTC
Created attachment 9905 [details]
designer showing nothing for AddAnimal.Type
Comment 6 Paul Johnson 2015-02-18 07:15:45 UTC
Created attachment 9906 [details]
Screen shot of the string editor from XS
Comment 7 Paul Johnson 2015-02-18 07:16:48 UTC
Created attachment 9907 [details]
Project strings.xml file. No build errors show with this file
Comment 8 Paul Johnson 2015-02-18 07:17:19 UTC
=== Xamarin Studio ===

Version 5.7.1 (build 17)
Installation UUID: f3d1a29c-1ba2-4a83-a193-1087efe91a85
Runtime:
	Mono 3.12.0 ((detached/de2f33f)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000076

=== Apple Developer Tools ===

Xcode 6.1.1 (6611)
Build 6A2008a

=== Xamarin.Mac ===

Version: 1.12.0.4 (Business Edition)

=== Xamarin.iOS ===

Version: 8.6.1.26 (Business Edition)
Hash: 98ee412
Branch: 
Build date: 2015-02-11 04:37:05-0500

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/PFJ/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		1.6    (API level 4)
		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)
		5.0    (API level 21)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

=== Build Information ===

Release ID: 507010017
Git revision: 0bc7d3550b6b088ac25b08dcf7bbe73bcc8658b3
Build date: 2015-02-03 19:43:29-05
Xamarin addins: f7b7d34419c9ec24501bfa7c658e80a6305613e0

=== Operating System ===

Mac OS X 10.10.3
Darwin Pauls-iMac.local 14.3.0 Darwin Kernel Version 14.3.0
    Thu Jan 22 23:54:42 PST 2015
    root:xnu-2782.20.26~5/RELEASE_X86_64 x86_64
Comment 9 Jérémie Laval 2015-02-18 11:20:52 UTC
The strings.xml file you linked has duplicated entries in it and doesn't compile for me.
Comment 10 Paul Johnson 2015-02-18 11:34:38 UTC
By entries, do you mean the likes of <string name="foo"> or the contents between the <> and </> tags?
Comment 12 Jérémie Laval 2015-02-18 11:55:44 UTC
String entries like Common.None:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Tool exited with code: 1. Output: obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Common.Nothing is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Common.Capacity is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Common.None is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Common.Rate is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Error.Crops.NoCrops.Farms is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Error.Paddocks.NoPads.Farms is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Error.Network.Title is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Error.General.Title is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Livestock.Summary.Events is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry RDialog.server.contact is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry RDialog.server.bad is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Implements.Implement is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Paddocks.Title is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Distance.acre.short is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Distance.hectare.short is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Buy.purchased is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Buy.from is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry BuySell.common.nvd is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry BuySell.common.price is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry BuySell.common.Date is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Sell.sold is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Sell.to is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry Sell.pic is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry BuySell.added is already defined.

obj/Debug/res/values/extra_strings.xml:1: error: Resource entry BuySell.on is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry CropEvent.spread is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry CropEvent.spray is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry CropEvent.sowed is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry CropEvent.sampled is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry CropEvent.raked is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry CropEvent.mowed is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry CropEvent.harvested is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry CropEvent.baled is already defined.
obj/Debug/res/values/extra_strings.xml:1: error: Resource entry CropEvent.tilled is already defined.

etc...
Comment 15 Jérémie Laval 2015-02-18 14:42:05 UTC
I can confirm the reason you were not seeing the errors in the first place is an aapt bug.

I added a workaround in Xamarin.Android itself.

For the issue at hand here, it's indeed due to duplicate resource entry names.
Comment 16 Paul Johnson 2015-02-18 17:20:33 UTC
The odd thing is that this file was brought in from the iOS version with search and replace used for creating the Android version. The iOS version reports no problems and that is usually very strict when it comes to duplicates.