4

I'm using all the latest tools and gradle versions for Materializing my app. Previously, everything working fine but now the button style colored is causing error in versions lower than Lollipop.

The parent theme i'm using-

Theme.AppCompat.Light.NoActionBar

and Defined colors in theme-

"colorPrimary", "colorPrimaryDark", "colorAccent", "colorButtonNormal", colorControlNormal", "colorControlActivated", "colorControlHighlight"

here is the Button view--

line:114 <android.support.v7.widget.AppCompatButton
    android:id="@+id/act_first_lock_btn_next"
    style="@style/Widget.AppCompat.Button.Colored"
    android:layout_width="200dp"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:layout_marginBottom="20dp"
    android:text="@string/next" />

here is the crash in kitkat 4.4.4-

Caused by: android.view.InflateException: Binary XML file line #114: Error inflating class android.support.v7.widget.AppCompatButton

if i remove the style style="@style/Widget.AppCompat.Button.Colored", error is gone but no colors on button.

The last thing i changed before the error occurred was updated to support lib version 23.2.0.

--UPDATE--

It is definitely a bug in support lib 23.2.0. Reported bug here- https://code.google.com/p/android/issues/detail?id=201937

Chris Banes (google dev) has merged the issue to-

https://code.google.com/p/android/issues/detail?id=201817

Arnav M.
  • 2,590
  • 1
  • 27
  • 44

2 Answers2

2

I tested on other machine and its a bug in support library version 23.2.0

So I've reported it on AOSP issue tracker here.

If you are having same issue...do star the issue on above link.

Thanks.

UPDATE Here comes the support library version 23.2.1... works like a charm!!

UPDATE Here comes the Support lib 23.3.0... and the charm goes away... complete story here.

I guess support library needs to be well tested before final release..

Community
  • 1
  • 1
Arnav M.
  • 2,590
  • 1
  • 27
  • 44
2

Try changing style="..." to android:theme="..."

anstaendig
  • 795
  • 5
  • 13