Go to Settings.gradle, inside repositories block ->
repositories {
maven { url 'https://jitpack.io' }
}
Now in build.gradle ->
com.github.lazycoder-21:FontAwesomeLibrary:v1.2
To use font awesome icon through XML
<lostankit7.droid.customview.FontAwesomeIcon
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:padding="10dp"
android:text="\uf058"
android:textColor="@color/purple_200"
android:textSize="25sp"
app:background_circular="true"
app:background_color="@color/white"
app:corner_radius="10dp"
android:clickable="true"
app:icon_type="fa_solid"
app:show_ripple="true"
app:show_stroke="true"
app:stroke_color="#A5B439"
app:stroke_width="1dp" />