Ionic 4 mobile back button issue

am developing an ionic4 app. after logout I am redirecting to the login page by using this.navController.navigateRoot method. to close the app by clicking the mobile back button I used the following code. it worked for a few days after that now I have to release an updated of this app if click on mobile back button it is not closing the app instead it redirecting to the previous open screen. can anyone help me to solve this issue? ionic version: 5.2.3
code:

ionViewDidEnter() {
this.subscription = this.platform.backButton.subscribe(async () => {
navigator[‘app’].exitApp();
});
}

ionViewWillLeave() {
this.subscription.unsubscribe();
}

getting following error in android log cat

E/Capacitor/Plugin/Console: ERROR Error: Uncaught (in promise): Error: StaticInjectorError[t -> t]: 
      StaticInjectorError(Platform: core)[t -> t]: 
        NullInjectorError: No provider for t!
    Error: StaticInjectorError[t -> t]: 
      StaticInjectorError(Platform: core)[t -> t]: 
        NullInjectorError: No provider for t!

Check this issue and try this.

Thanks but it is not working, same issue