[英]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个错误:找不到与给定名称匹配的资源:
attr windowNoTitle
attr colorPrimaryDark
attr windowActionBar
attr windowActionModeOverlay
attr colorAccent
attr colorPrimary
attr colorAccent
Theme.AppCompat.Light.Dialog
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.xaml
和Map.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: 请试试这个解决方案:
Update your Xamarin to the latest version (both shared project and your platform project). 将您的Xamarin更新到最新版本(共享项目和您的平台项目)。
Then redirect to C:\\Users\\<username>\\AppData\\Local\\
and rename the Xamarin
folder to Xamarin_old
. 然后重定向到
C:\\Users\\<username>\\AppData\\Local\\
并将Xamarin
文件夹重命名为Xamarin_old
。
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.axml
和Toolbar.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.