Monodroid:无法找到库'com.google.android.maps'

时间:2012-04-21 09:43:18

标签: c# xamarin.android

我正在尝试构建mondroid-sample https://github.com/xamarin/monodroid-samples/tree/master/MapsAndLocationDemo

每当我启动应用程序时,我在输出窗口中出现以下错误:

[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]

我检查了以下内容:

  • SDK Manager中安装的Google API
  • SDK管理器中安装的SDK Plattform
  • 我正在使用的AVD,定位到GoogleAPIs
  • 我以管理员身份运行Visual Studio
  • 我可以成功构建一个Hello World示例

由于我是Mono和Android开发的新手,我确信我错过了一些明显的东西,所以请耐心等待。

1 个答案:

答案 0 :(得分:1)

看看你的照片,并且你从未提及改变它,我打赌你的项目的目标是2.2。

在MonoDevelop中,转到Project - >选项 - >构建 - >一般,看看Target框架。默认设置是针对Android 2.2(Froyo),看起来您想要定位4.0或4.0.3。

将此更改为4.0或4.0.3,您应该好好去。