最近我根据新的 Android 指南将我的目标 SDK 更新为 29,但之后我收到了这个错误:
D:\Android Apps\PatherPane\app\src\main\res\values\styles.xml:4:5-9:13: AAPT: 错误: 样式属性 ‘attr/colorPrimary (又名 com.patherpane.app:attr/ colorPrimary)’ 未找到。
我的样式 XML 文件是:
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="SplashScreen" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">
@drawable/background_splashscreen
</item>
</style>
我怎样才能解决这个问题?
此命令后跟项目名称显示错误: Theme.AppCompat.Light.DarkActionBar
原文由 ProgrammerX 发布,翻译遵循 CC BY-SA 4.0 许可协议
确保您没有错过 build.gradle (app) 中的 appcompat 实现
要么
如果使用 androidx