I added navigation components into the project. All works fine under debug mode. But when generate the apk, it crashes directly after tap the icon.
So I modified minifyEnable to true under develop to see if any clue.
Then I came across the error:
Error inflating class androidx.fragment.app.FragmentContainerView
I checked the questions here: link1 and link2:
The activity is
class AppActivity : AppCompatActivity()
in the nav-graph.xml contains
app:startDestination.Added
implementation 'androidx.fragment:fragment-ktx:1.3.2'
All above don't work. Am I on the right direction? Thanks for the help.