1

我有以下问题:

我正在使用 CakeBuild 在 Windows 计算机 (Windows 10) 上构建我的 Xamarin.Forms 解决方案。

当我使用以下命令时,一切都很好:

MSBuild("MyXamarinApp.sln", configurator =>
        configurator.SetConfiguration("Debug")
          .SetMSBuildPlatform(MSBuildPlatform.x86));

但是,如果我删除“SetMSBuildPlatform(MSBuildPlatform.x86)”,它会在内部使用“MSBuildPlatform.x64”,然后我会收到以下错误:

(_GetReferenceAssemblyPaths target) ->
  C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(566,2): error MSB3644: The reference assemblies for framework "MonoAndroid,Version=v1.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

有人可以解释这种行为吗?我只能使用 x86 版本的 MSBuild 来构建 Xamarin 项目吗?

4

1 回答 1

0

您需要在 Android 应用程序目标中设置该平台。(AndroidProject -> 选项)。

x86 即桌面架构。您可以使用它在模拟器上构建和测试,但对于真实设备,您需要选择至少一种移动架构(任何不是 x86 或 x86_64 的架构)

在此处输入图像描述

于 2017-07-17T18:05:35.750 回答