Bug 20252 - Xamarin Forms: Android not finding Shared resources
Summary: Xamarin Forms: Android not finding Shared resources
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model ()
Version: Trunk
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: (C7)
Assignee: Lluis Sanchez
URL:
: 21917 ()
Depends on:
Blocks:
 
Reported: 2014-06-01 18:05 UTC by Ian
Modified: 2016-06-03 13:31 UTC (History)
6 users (show)

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


Attachments
Try to build the Android (7.80 MB, application/zip)
2014-06-01 18:05 UTC, Ian
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 Ian 2014-06-01 18:05:01 UTC
Created attachment 6945 [details]
Try to build the Android

Disclaimer: My first Xamarin.Form app...

Attached, super simple based on Hanselman's app.

In Android the BWNS.Shared is not picked up. iOS is fine

Attached.
Comment 1 Shruti 2014-06-02 04:07:48 UTC
I have tested this issue with attached project. It is reproduced at my end.

Screencast regarding same : http://screencast.com/t/F0oxndhZ

Error log is mentioned below :
'/Users/shruti/Downloads/Archive/Android/MainActivity.cs(7,7): Error CS0234: The type or namespace name `Shared' does not exist in the namespace `BWNS'. Are you missing an assembly reference? (CS0234) (BWNS.Android)

Build Output : https://gist.github.com/saurabh360/1ee0d337cd00dc7e3263

Environment Info :
=== Xamarin Studio ===

Version 5.0 (build 878)
Installation UUID: 1151d3d9-29c1-4339-b53c-a54856b47901
Runtime:
	Mono 3.4.0 ((no/51469e6)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 304000202

=== Xamarin.Android ===

Version: 4.12.4 (Enterprise Edition)
Android SDK: /Users/shruti/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.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.iOS ===

Version: 7.2.3.39 (Enterprise Edition)
Hash: fc6f56b
Branch: 
Build date: 2014-05-19 19:10:29-0400

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Build Information ===

Release ID: 500000878
Git revision: bcd66920d963483e7d638a2339c4022fe035b529
Build date: 2014-05-27 17:36:26-04
Xamarin addins: da9064ce55b0fa90930a7c437a4cc1ae0e5c778c

=== Operating System ===

Mac OS X 10.9.2
Darwin Shrutis-Mac-mini.local 13.1.0 Darwin Kernel Version 13.1.0
    Thu Jan 16 19:40:37 PST 2014
    root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
Comment 2 Lluis Sanchez 2014-06-02 05:31:56 UTC
The problem is that the attached project has an invalid .projitems file. The file is named BWNS.projitems and it should be BWNS.Shared.projitems, since it has to have the same name as the .shproj file. The android project is using the correct name to reference the projitems, so when the project is loaded, the reference is not found and it is ignored. I guess the files were renamed by hand.
Comment 3 Ian 2014-06-02 10:20:04 UTC
I used the IDE to rename the project from BWNS to BWNS.Shared using Command R. (Mac)

The IDE should then rename all the required areas.

Thanks for a great product!
Comment 4 Lluis Sanchez 2014-06-02 11:31:32 UTC
Fair enough, Rename has to be fixed.
Comment 5 David Nolan 2014-08-31 22:47:45 UTC
Reproduced this on Xamarin Studio 5.2.1 (build 1). Renaming the missed .projitems as well as the reference in the shared .shproj fixed Android. Can this be prioritised as a quick fix? It should just be a matter of adding the .projitems the existing rename operation.
Comment 6 Lluis Sanchez 2014-09-02 07:16:08 UTC
*** Bug 21917 has been marked as a duplicate of this bug. ***
Comment 7 Lluis Sanchez 2016-01-28 15:01:54 UTC
Already fixed in XS 6.0.
Comment 8 Abhishek 2016-06-03 13:31:27 UTC
I have checked this issue with latest C7 build:
XamarinStudio-6.0.0.5174_c2c4170731bec0e8361f2cbe836334efb7a97324. Now this issue is working fine. Here is the screencast for the same: http://www.screencast.com/t/MLgdWsMM

Hence closing this issue.

Thanks!