简体   繁体   English

找不到与给定名称匹配的资源

[英]No resource found that matches the given names

I'll build a Xamarin application but when I start the build for the Android project, The compiler gives me 9 errors: 我将构建一个Xamarin应用程序但是当我开始构建Android项目时,编译器给出了9个错误:

9 errors: No resource found that matches the given names: 9个错误:找不到与给定名称匹配的资源:

  1. attr windowNoTitle
  2. attr colorPrimaryDark
  3. attr windowActionBar
  4. attr windowActionModeOverlay
  5. attr colorAccent
  6. attr colorPrimary
  7. attr colorAccent
  8. Theme.AppCompat.Light.Dialog
  9. Theme.AppCompat.Light.DarkActionBar

Notes: The Errors happens in the file styles.xml in the Project.Droid project. 注意:错误发生在Project.Droid项目的文件styles.xml中。

Here you can find the styles.xml file: 在这里你可以找到styles.xml文件:

<?xml version="1.0" encoding="utf-8" ?>
<resources>

  <style name="MainTheme" parent="MainTheme.Base">
  </style>

  <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="colorPrimary">#2196F3</item>
    <item name="colorPrimaryDark">#1976D2</item>
    <item name="colorAccent">#FF4081</item>
    <item name="windowActionModeOverlay">true</item>
    <item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
  </style>

  <style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
    <item name="colorAccent">#FF4081</item>
  </style>

</resources>

I've nothing changed in the SmartBox.Droid project but got this errors. 我在SmartBox.Droid项目中没有任何改变,但是出现了这个错误。 Could the problem happen because I've added a MainPage.xaml and a Map.xaml in the SmartBox (Portable) project? 问题是否发生是因为我在SmartBox (Portable)项目中添加了MainPage.xamlMap.xaml I need two pages because I'll navigate between the two pages. 我需要两页,因为我将在两页之间导航。

I've searched everywhere on Google and SO but found no solution that helps me. 我在谷歌和搜索引擎优化的各个地方都进行了搜索,但没有找到能帮助我的解 My source code you could find on GitHub ( https://github.com/HeinPauwelyn/SmartBox ) in the folder Execution → SmartBox 我可以在GitHub( https://github.com/HeinPauwelyn/SmartBox )的文件夹Execution→SmartBox中找到我的源代码

Please try this solution: 请试试这个解决方案:

  1. Update your Xamarin to the latest version (both shared project and your platform project). 将您的Xamarin更新到最新版本(共享项目和您的平台项目)。

  2. Then redirect to C:\\Users\\<username>\\AppData\\Local\\ and rename the Xamarin folder to Xamarin_old . 然后重定向到C:\\Users\\<username>\\AppData\\Local\\并将Xamarin文件夹重命名为Xamarin_old

  3. Reopen your project, and build it. 重新打开您的项目,然后构建它。 It will take a few minutes until the packages are fully downloaded. 完全下载软件包需要几分钟。

Try editing the following lines in your Tabbar.axml and Toolbar.axml inside the Resources/Layout folder. 尝试在Resources / Layout文件夹中的Tabbar.axmlToolbar.axml编辑以下行。 This worked for me. 这对我有用。

Tabbar.axml Tabbar.axml

From: 从:

android:background="@style/colorPrimary"
app:tabIndicatorColor="@color/white"

To: 至:

android:background="?attr/colorPrimary"
app:tabIndicatorColor="@android:color/white"

Toolbar.axml Toolbar.axml

From: 从:

android:background="@style/colorPrimary"

To: 至:

android:background="?attr/colorPrimary"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 没有找到与给定名称匹配的资源,我在哪里做错了? - No resource found that matches the given name, where I do something wrong? 找不到与给定名称Styles.xml匹配的资源 - No resource found that matches the given name Styles.xml 在Xamarin.Android中找不到与给定名称匹配的资源(在&#39;headerLayout&#39;处) - No resource found that matches the given name (at 'headerLayout') in Xamarin.Android 设置Xamarin.Forms-“找不到与给定名称匹配的资源...” - Setup Xamarin.Forms - “No resource found that matches the given name…” 找不到与common_signin_btn_icon_dark.xml中的给定名称匹配的资源 - No resource found that matches the given name in common_signin_btn_icon_dark.xml 检索项目的父项时出错:找不到与给定名称“ThemeOverlay.AppCompat.Light”匹配的资源 - Error retrieving parent for item: No resource found that matches the given name 'ThemeOverlay.AppCompat.Light' Xamarin-检索项目的父项时出错:找不到与给定名称&#39;Theme.AppCompat.Light.DarkActionBar&#39;匹配的资源 - Xamarin - Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar' 找不到与给定名称匹配的资源(在&#39;src&#39;处,值为&#39;@android:drawable / logo.png - No resource found that matches the given name (at 'src' with value '@android:drawable/logo.png 未找到与请求URI匹配的HTTP资源,未找到与控制器匹配的类型 - No HTTP resource was found that matches the request URI, No type was found that matches the controller 未找到与给定名称匹配的资源(值与值 @integer/google_play_services_version)”- Visual Studio 2015 更新 3 - No resource found that matches the given name (at value with value @integer/google_play_services_version)” - Visual Studio 2015 Update 3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM