gpt4 book ai didi

java - Android 资源链接失败值,styles.xml

转载 作者:行者123 更新时间:2023-12-02 09:19:56 26 4
gpt4 key购买 nike

So i want to create a new android project then suddenly i have this error saying Android Resource Linking Failed and below here is my code.

Styles.xml

resources>

<!-- Base application theme. -->
<style type ="attr" name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item type="attr" name="colorPrimary">@color/colorPrimary</item>
<item type="attr" name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item type="attr" name="colorAccent">@color/colorAccent</item>
</style>

</resources>

显示错误

C:\Users\ASUS\Desktop\Rapih\Re_Mind\app\src\main\res\values\styles.xml:4:5-9:13: AAPT: error: style attribute 'attr/colorPrimary (aka app.com.re_mind:attr/colorPrimary)' not found.

最佳答案

使用类似的东西不要添加类型属性。这可能对你有帮助。

 <style name="AppTheme" parent="Base.Theme.MaterialComponents.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

关于java - Android 资源链接失败值,styles.xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58762468/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com