When I move from the debug build of my Android app to the release build, the back navigation arrow in the ActionBar gets replaced by the hamburger (for want of a better name), which is not what I want.
Here is the debug build, with the back arrow as it should be.
And here is the release build, with the hamburger.
It's the default back arrow that appears when the user navigates to a fragment using Jetpack Navigation Component, in an AppBarLayout that looks like this:
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
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">
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
When I turn minification off in the release version, the back arrow reappears. So it's something to do with minification.
But what do I tell ProGuard to keep? I tried all this but none of it helped:
-keep class androidx.appcompat.widget.Toolbar{}
-keep class androidx.navigation.NavController{}
-keep class androidx.navigation.Navigation{}
-keep class androidx.navigation.ui.AppBarConfiguration{}
-keep class androidx.navigation.ui.navigateUp.** {*;}
-keep class * extends android.support.v4.app.Fragment{}
-keep class com.google.android.material.appbar.AppBarLayout{}
Thanks in advance!

