Can't build latest Android Framework

Hello,

I’ve just downloaded the latest develop branch of Monogame from git and now I’m trying to compile the Monogame.Framework.Android solution. All dependency files/folders have been updated. It doesn’t compile and I’m getting weird compile errors - as if a DLL or something isn’t referenced because the errors don’t make sense:

------ Build started: Project: MonoGame.Framework.Android, Configuration: Debug Any CPU ------
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(25,40): error CS1003: Syntax error, ‘(’ expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(25,44): error CS1001: Identifier expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(25,59): error CS1041: Identifier expected; ‘string’ is a keyword
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(25,90): error CS1002: ; expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(25,97): error CS1519: Invalid token ‘>’ in class, struct, or interface member declaration
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(25,106): error CS1519: Invalid token ‘)’ in class, struct, or interface member declaration
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(27,26): error CS1519: Invalid token ‘)’ in class, struct, or interface member declaration
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(28,27): error CS1520: Method must have a return type
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(28,37): error CS1031: Type expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(30,23): error CS1519: Invalid token ‘=’ in class, struct, or interface member declaration
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(33,13): error CS1519: Invalid token ‘if’ in class, struct, or interface member declaration
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(33,35): error CS1519: Invalid token ‘>’ in class, struct, or interface member declaration
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(33,60): error CS1519: Invalid token ‘==’ in class, struct, or interface member declaration
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(34,27): error CS1520: Method must have a return type
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(34,45): error CS1031: Type expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(36,32): error CS1002: ; expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(36,50): error CS1001: Identifier expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(36,63): error CS1001: Identifier expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(36,76): error CS1001: Identifier expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(38,23): error CS1519: Invalid token ‘=’ in class, struct, or interface member declaration
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(40,26): error CS1519: Invalid token ‘;’ in class, struct, or interface member declaration
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(55,23): error CS1518: Expected class, delegate, enum, interface, or struct
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(58,27): error CS1518: Expected class, delegate, enum, interface, or struct
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(62,5): error CS1022: Type or namespace definition, or end-of-file expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\MessageBox.cs(63,1): error CS1022: Type or namespace definition, or end-of-file expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(24,42): error CS1003: Syntax error, ‘(’ expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(24,46): error CS1001: Identifier expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(24,61): error CS1041: Identifier expected; ‘string’ is a keyword
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(24,81): error CS1041: Identifier expected; ‘string’ is a keyword
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(24,106): error CS1041: Identifier expected; ‘bool’ is a keyword
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(24,134): error CS1002: ; expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(26,26): error CS1519: Invalid token ‘)’ in class, struct, or interface member declaration
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(27,27): error CS1520: Method must have a return type
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(27,37): error CS1031: Type expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(29,23): error CS1519: Invalid token ‘=’ in class, struct, or interface member declaration
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(31,32): error CS1002: ; expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(31,50): error CS1001: Identifier expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(31,63): error CS1001: Identifier expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(31,76): error CS1001: Identifier expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(31,93): error CS1001: Identifier expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(33,23): error CS1519: Invalid token ‘=’ in class, struct, or interface member declaration
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(35,26): error CS1519: Invalid token ‘;’ in class, struct, or interface member declaration
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(50,23): error CS1518: Expected class, delegate, enum, interface, or struct
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(53,27): error CS1518: Expected class, delegate, enum, interface, or struct
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(57,5): error CS1022: Type or namespace definition, or end-of-file expected
C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\Input\KeyboardInput.cs(58,1): error CS1022: Type or namespace definition, or end-of-file expected

Compile complete – 46 errors, 0 warnings
------ Build started: Project: Lidgren.Network.Android, Configuration: Debug Any CPU ------
Lidgren.Network.Android -> C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\ThirdParty\Lidgren.Network\bin\Android\AnyCPU\Debug\Lidgren.Network.dll
------ Build started: Project: MonoGame.Framework.Net.Android, Configuration: Debug Any CPU ------
error CS0006: Metadata file ‘C:\Users\sunomo\Documents\GitHub\Monogame\MonoGame\MonoGame.Framework\bin\Android\AnyCPU\Debug\MonoGame.Framework.dll’ could not be found

Compile complete – 1 errors, 0 warnings
========== Build: 1 succeeded or up-to-date, 2 failed, 0 skipped ==========

Example code:

Anyone have any ideas? I really want to get the latest code built as a game I’ve already published is now crashing under Android Lollipop - it crashes when you background the app (hitting the HOME key) then returning to the game. I’ve read around a lot of the forums and it seems this issue has been fixed but in the latest code - hence my trying to compile it.

Many thanks, Ian.

Looks like that code needs .net 4.5, and you are building with vs 2010 (.net 4).

If you aren’t using that feature you should be able to just comment out that chunk and continue. Putting an issue report on github would be a good idea too Thanks!

Many thanks daveleaver. I didn’t think of that. I’ll give it a go.

Ian