Bug 24437 - Fully qualified objects being reported as not being in a namespace
Summary: Fully qualified objects being reported as not being in a namespace
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Android Add-in ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Greg Munn
Depends on:
Reported: 2014-11-11 07:05 UTC by Paul Johnson
Modified: 2016-08-03 15:37 UTC (History)
2 users (show)

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

mvvmcross issue source (28.24 KB, application/zip)
2014-11-11 18:43 UTC, Paul Johnson

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:

Description Paul Johnson 2014-11-11 07:05:06 UTC
I'm following the mvvmcross tutorial on youtube (https://www.youtube.com/watch?v=uQT3_WXQQr0).

When I create the SubFrag, I'm being told that the type or namespace 'View' doesn't exist in the namespace 'Rock.Android.Views'

The code being objected to is this

public class SubFrag : MvxFragment
        public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Bundle savedInstanceState)
            var ignore = base.OnCreateView(inflater, container, savedInstanceState);
            return this.BindingInflate(Resource.Layout.SubFrag, null);

Anything after Views. is being reported as being missing by XS despite them being fully qualified.

If I add using Android.Views and remove the Android.Views. part from in front of (say) View, everything returns to normal.

Is this a Xam.Android issue or an mvvmcross conflict somewhere? It looks like a monodroid issue given the incorrect namespace is being resolved (see http://screencast.com/t/6uaZcuxW)

=== Xamarin Studio ===

Version 5.7 (build 322)
Installation UUID: f3d1a29c-1ba2-4a83-a193-1087efe91a85
	Mono 3.10.0 ((detached/633e444)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000020

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.Mac ===

Version: (Business Edition)

=== Xamarin.Android ===

Version: (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.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)
Java SDK: /usr
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 959c1e4
Build date: 2014-10-03 00:25:37-0400

=== Build Information ===

Release ID: 507000322
Git revision: e70496f26ed71a30bb1817f81fb372e573cd2686
Build date: 2014-10-22 10:14:44-04

=== Operating System ===

Mac OS X 10.10.1
Darwin Pauls-iMac.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 1 Greg Munn 2014-11-11 15:13:48 UTC
Hi Paul,

1. Even though Xamarin Studio is highlighting the type in red, does it still build?

2. If yes, try this

Close Xamarin Studio
delete ~/Library/Caches/XamarinStudio-5.0/DerivedData
Reopen Xamarin Studio, and your project

Can you let me know how that goes for you?

Comment 2 Paul Johnson 2014-11-11 17:11:43 UTC
Completely fails to build as it can't resolve Android.Views.View
Comment 3 Greg Munn 2014-11-11 17:22:48 UTC
Can you attach your project so I can try and replicate the issue please.
Comment 6 Paul Johnson 2014-11-11 18:42:54 UTC
Found it - it is part of the tutorial so didn't need the blessing :)
Comment 7 Paul Johnson 2014-11-11 18:43:35 UTC
Created attachment 8696 [details]
mvvmcross issue source
Comment 8 Greg Munn 2014-11-12 17:23:54 UTC
I didn't spot this before, but the error you get is 

The type or namespace name `View' does not exist in the namespace `Rock.Android.Views'. 

The clue here is the "Rock" bit. The namespace of SubFrag is inside Rock.Android.Views. The "qualified" namespace actually resolves to be inside the Rock namespace.

Qualify it like this instead