I created a custom button, it is appearing in the preview, but not on my phone. The minimum API is 17 and my phone's API is 27.
//custom button
<style name="taskButton" parent="Widget.AppCompat.Button">
<item name="android:layout_alignParentStart">true</item>
<item name="android:drawablePadding">-3dp</item>
<item name="android:background">@color/Red</item>
<item name="android:textAlignment">viewStart</item>
</style>
//xml
<Button
android:id="@+id/homeButton"
style="@style/taskButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|start"
android:drawableStart="@drawable/ic_home_black_24dp"
android:text="Home"
android:textAllCaps="false"
android:visibility="visible" />
I think I found out the problem. I had 2 xml files, one for api 21+ and another one for api 21-. I deleted both, and recreated a new one for all the versions. And my issue is fixed.