Maybe this approach is not the best practice and is only a temporary solution, but it's worth trying. In my case, the background is a transparent gradient, and the border is also a gradient, so I can't use the usual solution of replicating the background color.
Instead of creating a complex layer list, I used an SVG from the UI design (Figma) as the background and simply attached it to the background properties.
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/containerAproProgress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/space_16"
android:layout_marginTop="@dimen/space_24"
android:background="@drawable/box_apro_account"
android:padding="@dimen/space_16"
app:layout_constraintTop_toBottomOf="@+id/container_business_profile">
and heres the result