MonoAndroid版本8.0编译错误

时间:2018-04-10 11:14:11

标签: c# android xamarin.forms compiler-errors

我突然开始在我的Xamarin表单项目中出现此错误

/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild/Microsoft/NuGet/Microsoft.NuGet.targets(184,5):

 error : Your project is not referencing the "MonoAndroid,Version=v8.0" framework. Add a reference to "MonoAndroid,Version=v8.0" in the "frameworks" section of your project.json, and then re-run NuGet restore.

我尝试添加不同的引用,但无法解决问题。所以,我将文件重置为上次提交工作正常,但即便如此,我在我的android项目中收到此错误。

2 个答案:

答案 0 :(得分:3)

我做了以下对我有用的事情:

  1. 构建>全部清理
  2. 关闭Visual Studio
  3. 获得解决方案目录>在每个项目中删除 bin obj 文件夹
  4. 打开Visual Studio
  5. 构建>重建所有
  6. 它就像食物一样,如果你跳过一步它就行不通。

答案 1 :(得分:1)

首先,尝试清理和恢复nuget包 如果这不解决问题清理nuget缓存应该解决, 来自工具>选项> nuget包管理器>清除所有nuget缓存,不要忘记将android 8作为目标android版本放在项目属性中。

相关问题