Bug 10994 - Build failed. Object reference not set to an instance of an object.
Summary: Build failed. Object reference not set to an instance of an object.
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: 4.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2013-03-08 07:54 UTC by Jonathan Dunn
Modified: 2013-03-18 06:09 UTC (History)
4 users (show)

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

Ide Log (41.27 KB, application/octet-stream)
2013-03-08 19:12 UTC, Jonathan Dunn

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 Jonathan Dunn 2013-03-08 07:54:16 UTC
Hello, I'm a university student trying to get MonoGame working with Xamarin or MonoDevelop on My Mac, which is a 10.6.8 Mac Book Pro. I've installed Xcode 3.2.3, I've installed Xamarin 4.0 and used the Add-in Manager to download the MonoGame Project Templates, but whenever I start a MonoGame solution in Xamarin and build it I get this error. 

Build failed. Object reference not set to an instance of an object.

When I try to install the MonoGame Template project in MonoDevelop 3.0.6 I get this problem.

The selected add-ins can't be installed because there is dependancy conflicts.
The Package "Core V3" can not be found in any repository.
The Package "Ide V3" can not be found in any repository.
The Package "Source Editor2 V3" can not be found in any repository.
The Package "Refactoring V3" can not be found in any repository.
The Package "Autotools V3" can not be found in any repository.

I've tried downloading different versions of MonoDevelop with no success

Please help, i've spent 3 days trying to get it working, and if I don't get it to work I might fail my course :(

Thank you for your help in advance.
Comment 1 Sebastien Pouliot 2013-03-08 08:14:56 UTC
It's not clear if you're talking about "Xamarin Studio" on the Mac (which is free) or "Xamarin.Mac" which is a commercial product to offer .NET bdingins and tooling for OSX API.

* Xcode 3.2.x is not supported by the latest products (including Xamarin Studio 4.0). Some things _might_ work but the Xcode integration for XIB files won't work. You'll need at least Xcode 4.2;

* Xamarin.Mac requires at least MonoDevelop 3.1.x, earlier versions won't support it (but will support the open source version MonoMac);

* A lot of the latest tools (e.g. Xcode 4.3+) won't work on Snow Leopard (OSX 10.6) which Apple stopped supporting last year;
Comment 2 Jonathan Dunn 2013-03-08 09:25:21 UTC
Hi Seb, I was referring to Xamarin Studio, sorry for the confusion.

Thank you for clearing that up for me, it looks like i'll have to upgrade to Lion OS then if i'm to get MonoGame working. 

Thanks for the help
Comment 3 Sebastien Pouliot 2013-03-08 09:31:47 UTC
-> MD
Comment 4 Jonathan Dunn 2013-03-08 10:37:19 UTC
MD? As in MonoDevelop? I do not understand what your trying to say.
Comment 5 Mikayla Hutchinson [MSFT] 2013-03-08 15:59:58 UTC
Yes, he was reassigning the bug to MonoDevelop. Xamarin Studio is MonoDevelop 4.0.
Comment 6 Mikayla Hutchinson [MSFT] 2013-03-08 16:01:34 UTC
When you get that build error, could you check the logs (~/Library/Logs/XamarinStudio-4.0/Ide.log) for a stack trace?
Comment 7 Jonathan Dunn 2013-03-08 19:12:26 UTC
Created attachment 3562 [details]
Ide Log

Hi, I've included the Ide Log if you'd like to have a look, I really wouldn't know where to start.

Thanks for your help, I love programming, but it takes its time for you to get your head around!
Comment 8 Mikayla Hutchinson [MSFT] 2013-03-08 20:46:13 UTC
What are the SDK Location settings in Preferences?
Comment 9 Jonathan Dunn 2013-03-09 12:39:59 UTC
The Apple SDK location says SDK was found. 

The Xamarian.iOS SDK says no SDK found at default location. 

What should I do to resolve this?
Comment 10 Mikayla Hutchinson [MSFT] 2013-03-09 15:43:14 UTC
How did you install Xamarin.iOS? Do you have the /Developer/MonoTouch directory?
Comment 11 Jeffrey Stedfast 2013-03-09 18:47:59 UTC
Somehow his configuration is trying to use /Applications/MonoDevelop.app/Contents/MacOS/MonoDoc.app as the SDK location for Xamarin.iOS

You need to point that at your MonoTouch install directory, which is probably /Developer/MonoTouch
Comment 12 Jonathan Dunn 2013-03-09 19:15:55 UTC
I don't believe I have MonoTouch install, is that necessary to get MonoGame working with Xamarin Studio?

If not could you give me a better indication where to find the SDK directory I need to use as the default.
Comment 13 Jeffrey Stedfast 2013-03-09 19:31:37 UTC
Well, what platform are you going to be deploying to?
Comment 14 Jonathan Dunn 2013-03-09 20:09:36 UTC
My university project is to use XNA to make a game for windows, I only have a mac at home so it would be necessary to be able to make a game for windows on my mac if possible.
Comment 15 Jeffrey Stedfast 2013-03-09 20:42:18 UTC
Okay, then you don't need Xamarin.iOS (aka MonoTouch).

I guess we were assuming you were trying to build an iOS app.

Do you still get a build failure when trying to build a standard MonoGame app now that you've installed Xamarin Studio?
Comment 16 Jonathan Dunn 2013-03-09 21:14:56 UTC
I have now updated to Lion OS X, and installed the latest Xcode, but when I try and build a MonoGame for Windows program I get this.

/Users/hotmnemonic/Projects/WinGame/WinGame/Game1.cs(50,50): Error CS0246: The type or namespace name `Texture2d' could not be found. Are you missing a using directive or an assembly reference? (CS0246) (WinGame)

When I try to build a MonoGame for Mac I get this.

Warning: The referenced library 'MonoGame.Framework.dll' is not used from any code, skipping extraction of content resources. (Bug)

I've spent so much time trying to get this working, so I really appreciate your advice.
Comment 17 Mikayla Hutchinson [MSFT] 2013-03-09 21:47:57 UTC
I think you'll need to ask the MonoGame guys about that, it souunds like their addin isn't adding correct assembly references.
Comment 18 dean.ellis 2013-03-13 15:12:43 UTC
AFAIK, there is an issue with the Mac project in MonoGame because it is a normal MonoMac project it doesn't use the additional code in the addin to copy the binaries that ship with the Addin, so you need to download the code from github and add the MonoGame.Framework.MacOS.csproj to your solution and add it to the references.

As far as the other error goes did you but and paste that error? If so "Texture2d" does not exist as a class in XNA, I think you might be after "Texture2D"