android - 无法在 Visual Studio 2015 中构建我的第一个默认 Xamarin Form android 项目

标签 android xamarin xamarin.forms

我是移动开发新手。我在 xamarin 中遇到的错误,但我觉得这不是 xamarin 特有的,而是与 android sdk 相关的

我尝试在 Visual Studio 2015 中进行设置。我遵循了 xamarin 网站上的所有步骤。谁能帮我找到并解决这个问题。

尝试创建 Xamarin Form 可移植应用程序。并在 Droid 项目中出现错误。

  1. 没有任何修改和使用默认设置给我:

Error       Error retrieving parent for item: No resource found that matches the given name 'Platform.V11.AppCompat'.   App2.Droid  \App2.Droid\obj\Debug\resourcecache\B237B8541B965BBE5CA1DD64CF2395A7\res\values-v14\values-v14.xml  15  
Error       Error retrieving parent for item: No resource found that matches the given name 'Platform.V11.AppCompat.Light'. App2.Droid  \App2.Droid\obj\Debug\resourcecache\B237B8541B965BBE5CA1DD64CF2395A7\res\values-v14\values-v14.xml  21  
Error       Error retrieving parent for item: No resource found that matches the given name 'Base.V11.Theme.AppCompat.Dialog'.  App2.Droid  \App2.Droid\obj\Debug\resourcecache\B237B8541B965BBE5CA1DD64CF2395A7\res\values-v21\values-v21.xml  131 
Error       Error retrieving parent for item: No resource found that matches the given name 'Base.V11.Theme.AppCompat.Light.Dialog'.    App2.Droid  \App2.Droid\obj\Debug\resourcecache\B237B8541B965BBE5CA1DD64CF2395A7\res\values-v21\values-v21.xml  182 
Error       Error retrieving parent for item: No resource found that matches the given name 'Base.V22.Theme.AppCompat'. App2.Droid  \App2.Droid\obj\Debug\resourcecache\B237B8541B965BBE5CA1DD64CF2395A7\res\values-v23\values-v23.xml  11  
Error       Error retrieving parent for item: No resource found that matches the given name 'Base.V22.Theme.AppCompat.Light'.   App2.Droid  \App2.Droid\obj\Debug\resourcecache\B237B8541B965BBE5CA1DD64CF2395A7\res\values-v23\values-v23.xml  17  

============================================= =========================

  1. 将“使用 Android 版本编译”更改为 Android5.0 给我:

Error       Error retrieving parent for item: No resource found that matches the given name 'Platform.V11.AppCompat'.   App2.Droid  \App2.Droid\obj\Debug\resourcecache\B237B8541B965BBE5CA1DD64CF2395A7\res\values-v14\values-v14.xml  15  
Error       Error retrieving parent for item: No resource found that matches the given name 'Platform.V11.AppCompat.Light'. App2.Droid  \App2.Droid\obj\Debug\resourcecache\B237B8541B965BBE5CA1DD64CF2395A7\res\values-v14\values-v14.xml  21  
Error       Error retrieving parent for item: No resource found that matches the given name 'Base.V11.Theme.AppCompat.Dialog'.  App2.Droid  \App2.Droid\obj\Debug\resourcecache\B237B8541B965BBE5CA1DD64CF2395A7\res\values-v21\values-v21.xml  131 
Error       Error retrieving parent for item: No resource found that matches the given name 'Base.V11.Theme.AppCompat.Light.Dialog'.    App2.Droid  \App2.Droid\obj\Debug\resourcecache\B237B8541B965BBE5CA1DD64CF2395A7\res\values-v21\values-v21.xml  182

我的默认 package.config 如下所示:

  <package id="Xamarin.Android.Support.Design" version="23.0.1.3" targetFramework="monoandroid60" />
  <package id="Xamarin.Android.Support.v4" version="23.0.1.3" targetFramework="monoandroid60" />
  <package id="Xamarin.Android.Support.v7.AppCompat" version="23.0.1.3" targetFramework="monoandroid60" />
  <package id="Xamarin.Android.Support.v7.CardView" version="23.0.1.3" targetFramework="monoandroid60" />
  <package id="Xamarin.Android.Support.v7.MediaRouter" version="23.0.1.3" targetFramework="monoandroid60" />
  <package id="Xamarin.Forms" version="2.0.0.6482" targetFramework="monoandroid60" />

更新到最新的稳定 Xamarin.Forms 2.1.0.6529 给我同样的错误。

我的 SDK 管理器如下所示:

enter image description here

enter image description here

最佳答案

您可以在这里找到答案: https://forums.xamarin.com/discussion/46840/error-retrieving-parent-for-item-no-resource-found-that-matches-given-name

你是对的,这似乎与 droid sdk 有关。 上述页面的摘录: “修复了它。事实证明卸载和重新安装组件和 SDK 已经修复了它。(是一个损坏的 AppCompat V7 文件)”

关于android - 无法在 Visual Studio 2015 中构建我的第一个默认 Xamarin Form android 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36534741/

相关文章:

android - Flutter - 如何获取 TextField 值并将其显示为新文本

javascript - 与远程数据库通信的 PhoneGap 应用程序

android - 将信息从 EventListener 传回 Activity

ios - 在哪里可以找到 'Missing Marketing Icon'

Xamarin Tap 事件不适用于 iOS 但适用于 Android

xamarin - 如何在 Xamarin.Forms 中播放系统声音

android - 设备管理不起作用

android - Xamarin.Forms.Labs Mediapicker 卡在 Android 上尝试使用异步方法从照片库中提取图像

c# - bool 到图像转换器不起作用。图像不变

c# - HttpClientHandler :Dispose (bool )' is inaccessible from method ` System.Net.ServicePointManager:CloseConnectionGroup(字符串)