I’m trying to build the mondroid-sample https://github.com/xamarin/monodroid-samples/tree/master/MapsAndLocationDemo.
Whenever I start the application I get the following error in the output window:
[STDOUT] "C:\Dev\Playground\monodroid-samples\MapsAndLocationDemo\MapsAndLocationDemo.csproj" (SignAndroidPackage target) (1) ->
[STDOUT] (_GenerateJavaStubs target) ->
[STDOUT] C:\Program Files (x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(595,3): error MSB4018: The "GenerateJavaStubs" task failed unexpectedly. [C:\Dev\Playground\monodroid-samples\MapsAndLocationDemo\MapsAndLocationDemo.csproj]
[STDOUT] C:\Program Files (x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(595,3): error MSB4018: System.InvalidOperationException: AndroidManifest.xml : error 1: Unable to find library 'com.google.android.maps'. [C:\Dev\Playground\monodroid-samples\MapsAndLocationDemo\MapsAndLocationDemo.csproj]
[STDOUT] C:\Program Files (x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(595,3): error MSB4018: bei Xamarin.Android.Tasks.ManifestDocument.AddAddOns(XElement app) [C:\Dev\Playground\monodroid-samples\MapsAndLocationDemo\MapsAndLocationDemo.csproj]
[STDOUT] C:\Program Files (x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(595,3): error MSB4018: bei Xamarin.Android.Tasks.ManifestDocument.Merge(List`1 subclasses, List`1 selectedWhitelistAssemblies, Boolean embed) [C:\Dev\Playground\monodroid-samples\MapsAndLocationDemo\MapsAndLocationDemo.csproj]
[STDOUT] C:\Program Files (x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(595,3): error MSB4018: bei Xamarin.Android.Tasks.GenerateJavaStubs.Execute() [C:\Dev\Playground\monodroid-samples\MapsAndLocationDemo\MapsAndLocationDemo.csproj]
[STDOUT] C:\Program Files (x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(595,3): error MSB4018: bei Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\Dev\Playground\monodroid-samples\MapsAndLocationDemo\MapsAndLocationDemo.csproj]
[STDOUT] C:\Program Files (x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(595,3): error MSB4018: bei Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) [C:\Dev\Playground\monodroid-samples\MapsAndLocationDemo\MapsAndLocationDemo.csproj]
I’ve checked the following:
- Google APIs installed in SDK Manager
- SDK Plattform installed in SDK Manager
- The AVD I’m using, targets the GoogleAPIs
- I’m running Visual Studio as an Administrator
- I can successfully build a Hello World example
As I’m new to Mono and Android development I’m sure I’m missing something obvious, so please bear with me.
Looking at your picture, and that you never mention changing it, I bet your project is targeting 2.2.
In MonoDevelop, go to Project -> Options -> Build -> General, and look at the Target framework. The default is to target Android 2.2 (Froyo), and it looks like you want to target 4.0 or 4.0.3.
Change this to 4.0 or 4.0.3 and you should be good to go.