如何修复 mac 版本的 android 日食"检索项目的父级时出错:找不到与给定名称"主题.AppCompat.Light"匹配的资源?



编译时,我得到错误:"检索项目的父级错误:没有找到与给定名称' theme . apppat . light '匹配的资源"。项目中的路径应该是什么?mac上的属性?该代码在Windows计算机上运行良好…

<!--
    Base application theme, dependent on API level. This theme is replaced
    by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">  <-- Error at line 7
    <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
    -->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

提前感谢!

您需要将AppCompat导入工作区并作为库项目引用。你可以从Android SDK管理器中获取。

最新更新