oli107 / material-range-bar

Android widget for selecting a range of values.
Apache License 2.0
1.67k stars 371 forks source link

How to define styles in styles.xml? #196

Closed ericntd closed 4 years ago

ericntd commented 4 years ago

./gradlew assembleDebug is working but ./gradlew assembleRelease is failing:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':cmb-views:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     /Users/ericn/AndroidStudioProjects/CMBAndroid copy/mypackage/cmb-views/build/intermediates/packaged_res/debug/values/values.xml:881:5-890:11: AAPT: error: style attribute 'attr/mrb_rangeBarColor (aka com.mypackage:attr/mrb_rangeBarColor)' not found.

     /Users/ericn/AndroidStudioProjects/CMBAndroid copy/mypackage/cmb-views/build/intermediates/packaged_res/debug/values/values.xml:881:5-890:11: AAPT: error: style attribute 'attr/mrb_connectingLineColor (aka com.mypackage:attr/mrb_connectingLineColor)' not found.

     /Users/ericn/AndroidStudioProjects/CMBAndroid copy/mypackage/cmb-views/build/intermediates/packaged_res/debug/values/values.xml:881:5-890:11: AAPT: error: style attribute 'attr/mrb_selectorColor (aka com.mypackage:attr/mrb_selectorColor)' not found.

     /Users/ericn/AndroidStudioProjects/CMBAndroid copy/mypackage/cmb-views/build/intermediates/packaged_res/debug/values/values.xml:881:5-890:11: AAPT: error: style attribute 'attr/mrb_selectorSize (aka com.mypackage:attr/mrb_selectorSize)' not found.

     /Users/ericn/AndroidStudioProjects/CMBAndroid copy/mypackage/cmb-views/build/intermediates/packaged_res/debug/values/values.xml:881:5-890:11: AAPT: error: style attribute 'attr/mrb_tickHeight (aka com.mypackage:attr/mrb_tickHeight)' not found.

     /Users/ericn/AndroidStudioProjects/CMBAndroid copy/mypackage/cmb-views/build/intermediates/packaged_res/debug/values/values.xml:881:5-890:11: AAPT: error: style attribute 'attr/mrb_pinColor (aka com.mypackage:attr/mrb_pinColor)' not found.

     /Users/ericn/AndroidStudioProjects/CMBAndroid copy/mypackage/cmb-views/build/intermediates/packaged_res/debug/values/values.xml:881:5-890:11: AAPT: error: style attribute 'attr/mrb_pinRadius (aka com.mypackage:attr/mrb_pinRadius)' not found.

     /Users/ericn/AndroidStudioProjects/CMBAndroid copy/mypackage/cmb-views/build/intermediates/packaged_res/debug/values/values.xml:891:5-894:11: AAPT: error: style attribute 'attr/mrb_tickHeight (aka com.mypackage:attr/mrb_tickHeight)' not found.

     /Users/ericn/AndroidStudioProjects/CMBAndroid copy/mypackage/cmb-views/build/intermediates/packaged_res/debug/values/values.xml:891:5-894:11: AAPT: error: style attribute 'attr/mrb_tickColor (aka com.mypackage:attr/mrb_tickColor)' not found.

From styles.xml

  <style name="rangebar_dls">
    <item name="mrb_rangeBarColor">@color/gray</item>
    <item name="mrb_connectingLineColor">?attr/main_color</item>
    <item name="mrb_selectorColor">?attr/main_color</item>
    <item name="mrb_selectorSize">@dimen/four_dp</item>
    <item name="mrb_tickHeight">0dp</item>
    <item name="mrb_pinColor">?attr/main_color</item>
    <item name="mrb_pinRadius">@dimen/zero_dip</item>
    <item name="android:textColor">@color/transparent</item>
  </style>

  <style name="rangebar_with_ticks_dls" parent="rangebar_dls">
    <item name="mrb_tickHeight">@dimen/one_dp</item>
    <item name="mrb_tickColor">?attr/main_color</item>
  </style>

Versions: Material Range Bar 1.4.7

buildTools: "28.0.3",
        compileSdk: 28,
        minSdk    : 23,
        targetSdk : 28,
ericntd commented 4 years ago

Closing as it's not specific to this library and I asked the question on StackOverflow