Gradle build error style attributes not found

前端 未结 4 1094
伪装坚强ぢ
伪装坚强ぢ 2021-01-04 13:40

I was trying to roll my project back to a previous version by checking the git out from GitHub, but I think I did it in a wrong way. I just removed the local project and che

相关标签:
4条回答
  • 2021-01-04 14:12

    If you use a theme style with parent="android:Theme.DeviceDefault", you should use

    <item name="android:windowActionBar">false</item>
    

    instead of

    <item name="windowActionBar">false</item>
    

    Or change the theme style from "android:Theme.DeviceDefault" to "Theme.AppCompat.Light.DarkActionBar", it also may resolves some other style problems.

    0 讨论(0)
  • 2021-01-04 14:23

    That is a problem with themes and styles. Probably one of your libraries is expecting that style to be available and it's not finding it. See here Cant set Android Actionbar Background correctly as a guide on how to fill in that particular attribute that may work for you.

    This resource seems to have been introduced in 2013 according to google's diffs here https://android.googlesource.com/platform/tools/base/+/f5215ae4712f468568b58c20baadd14b769c10c4%5E!/

    Changing your themes.xml followed by using it from the manifest, or changing styles.xml can potentially cause those side effects if not done properly.

    0 讨论(0)
  • 2021-01-04 14:25

    2020 UPDATE: Unfortunately, it seems they haven't fix this issue yet, so the solution is to simple downgrade gradle version. For example, change it from:

    classpath 'com.android.tools.build:gradle:3.6.3'

    to

    classpath 'com.android.tools.build:gradle:3.5.1'

    and it will work.

    0 讨论(0)
  • 2021-01-04 14:26

    Adding Preference Support Library v7 dependency to Gradle solved a problem for me. It supports missed attributes for @style/PreferenceThemeOverlay.

    Put the following line to your build.gradle module:

    com.android.support:preference-v7:27.1.1

    0 讨论(0)
提交回复
热议问题