我在Xamarin Studio编译我的Android应用程序遇到了困难。出现的错误如下所示:
没有找到与给定名称attr“colorPrimary”匹配的资源
这是指我的styles.xml:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="@android:style/Theme.Material.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<!--item name="colorPrimaryDark">@color/colorPrimaryDark</item-->
<!--item name="colorAccent">@color/colorAccent</item-->
</style>
</resources>
在网上常见的建议是将SDK版本设置为21或更高版本。但我已经尝试过:
- 在清单中将minSdkVersion设置为21
- 在清单中将targetSdkVersion设置为21
- 在项目设置中将目标框架设置为Android 5.0
- 清理并重建项目
错误仍然存在:-( 还需要其他设置才能使其工作吗?
android:colorPrimary
吗? - K Neeraj Lal