找不到与给定名称匹配的资源(在 'theme' 处,值为 '@android:style/Theme.my_theme')。(APT0000)

No resource found that matches the given name (at 'theme' with value '@android:style/Theme.my_theme').(APT0000)

我最近安装了全新的 Xamarin Android(版本 5.10.1 build 6)。当我尝试添加主题时,我遇到了可怕的 "No resource found..." 错误。
这是我尝试添加的第一个主题,所以我不确定问题是否出在我的代码中。 然而,在 Whosebug 和 Xamarin 论坛上搜索时,我发现这个问题可能意味着某些 Android 库没有安装。

所以我从最新和以前的 API 以及 Extras 安装了很多东西,但我仍然遇到同样的错误。
该应用程序只是一个针对手机的简单应用程序,所以我没有安装 wear 或 tv 库。 Android API 需要追溯到多远?
有什么我应该安装的不明显的东西吗?

对于这个特定的错误,已经有很多答案,但其中很多都含糊不清,没有给出确切的说明,或者引用我不认识的组件,我想是因为我使用 Xamarin.

这是我的主题代码。

<?xml version="1.0" encoding="UTF-8" ?>
<resources>
  <style name="Theme.my_theme" parent="@android:style/Theme.DeviceDefault.Light.DialogWhenLarge">
    <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> <item name="android:textSize">20sp</item>
  </style>
</resources>

这是清单。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="My_app.My_app">
    <uses-sdk android:minSdkVersion="17" />
    <application android:label="My_app" android:theme="@android:style/Theme.my_theme" android:icon="@drawable/icon"></application>
</manifest>

Android 管理器显示已安装的内容。有没有明显的东西没有安装?

表达式 @android:style/Theme.my_theme 指向 android 命名空间中名为 Theme.my_theme 的资源,而不是您的本地应用程序包。

android:theme="@android:style/Theme.myTheme" 更改为 android:theme="@style/Theme.myTheme" 以修复错误。