vpaliy / android-movies-app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash when viewing media details

SalmanTKhan opened this issue · comments

The MediaDetailsFragment crashes onCreateView, I'm running the app on a Samsung S7 Edge running Android Nougat 7.0

Caused by: android.view.InflateException: Binary XML file line #54: Binary XML file line #79: Error inflating class com.vpaliy.chips_lover.ChipsLayout
Caused by: android.view.InflateException: Binary XML file line #79: Error inflating class com.vpaliy.chips_lover.ChipsLayout

Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 11 to color: type=0x5
at android.content.res.TypedArray.getColor(TypedArray.java:480)
at com.vpaliy.chips_lover.ChipBuilder.<init>(ChipBuilder.java:43)
at com.vpaliy.chips_lover.ChipBuilder.create(ChipBuilder.java:152)
at com.vpaliy.chips_lover.ChipsLayout.initAttrs(ChipsLayout.java:43)
at com.vpaliy.chips_lover.ChipsLayout.<init>(ChipsLayout.java:37)
at com.vpaliy.chips_lover.ChipsLayout.<init>(ChipsLayout.java:32)

So in layout_media_description.xml line 84 and 85 seem to cause the issue, removing them prevents a crash.

app:chip_layout_horizontal_margin="@dimen/spacing_small"
app:chip_layout_vertical_margin="@dimen/spacing_small"

That's interesting! I don't have this issue on a Nexus 6P (Android O). Also, I've tried a few other devices with a lower API, it still runs okay.
Do you still have the issue? It looks like the ChipsLover library has some issues. If so, then removing the lines above will fix the issue. Anyways, I'll fix it.

Have you tried running the app on an emulator?

Tried it on an emulator (Pixel XL with Android O), same result with those lines being there.

Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 12 to color: type=0x5

It's been fixed now.