enter image description here kotlin version : 1.6.1 implementation "androidx.appcompat:appcompat:1.4.2" // I used 1.6.1 too but no use implementation "androidx.fragment:fragment-ktx:1.5.1" implementation "androidx.activity:activity-ktx:1.5.1"
While taking ctrl reference from the base activity : I encountered similar issue described here Wrong version of androidx.fragment:fragment used
I need to resolve onBackPressed deprecation with onBackpressedDispatcher
In your fragment you should call like this
Fore more details refer : OnBackPressedDispatcher