android.view.InflateException: Binary XML file line #28: Error inflating class TextView-ThrowExceptions

Exception or error:

I ran into this exception in trying to inflate a layout which contains this Textview. The widget itself has a custom style, a coordinator layout behaviour appended to it. The app is already in production and I’m facing a crash regarding this textview. Here’s my layout:

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 
 xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:app="http://schemas.android.com/apk/res-auto"
 xmlns:tools="http://schemas.android.com/tools"
 android:id="@+id/root"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 tools:context=".ads.AdsActivity">

<com.google.android.material.appbar.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        app:popupTheme="@style/AppTheme.PopupOverlay" />


</com.google.android.material.appbar.AppBarLayout>

<include
    android:id="@+id/content_main"
    layout="@layout/content_main" />

<TextView
    android:id="@+id/publish_ad"
    style="@style/ActionButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|center"
    android:layout_marginBottom="16dp"
    android:background="@drawable/rounded_corner_background_accent"
    android:drawableStart="@drawable/ic_action_information_rotate"
    android:drawableLeft="@drawable/ic_action_information_rotate"
    android:drawablePadding="6dp"
    android:text="@string/str_ads_publier"
    android:visibility="visible"
    app:layout_behavior="com.devengine.paladin.coinafrique.widget.CollapsibleViewBehavior"
    tools:visibility="visible" />

<com.roughike.bottombar.BottomBar
    android:id="@+id/bottombar"
    android:layout_width="match_parent"
    android:layout_height="66dp"
    android:layout_gravity="bottom"
    android:layout_marginBottom="-9dp"
    android:gravity="center_vertical"
    app:bb_activeTabColor="@color/gold"
    app:bb_behavior="shy"
    app:bb_inActiveTabColor="@color/dark_blue"
    app:bb_tabXmlResource="@xml/bottom_bars"
    app:bb_titleTextAppearance="@style/BottomMenuText"
    app:layout_scrollFlags="scroll|enterAlways" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

Is there any workaround for this kind of issue ? I’ve already checked on many s.o related questions but none of them have satisfying solutions

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *