IONIC 5 , APP Freeze and unresponsive if application comes to foreground

Getting strange issue for ionic 5 app, Application works fine till it is in foreground. Once application minimize and again maximize it is unresponsive, freeze on scroll , page routing are slow. I have checked in logcat logs , it shows Skip 100 frames, Main thread doing too much work . but app is just come back to foreground nothing changed. also shows error activityResumeTrigger: not whiteListed /mainactivity .

I am using ionic 5.4.16

Hope someone answer it,

Forget to mention , i have implemented AWS App Sync, is that the reason of main thread doing lots of work when app resume.

my package.json

{
“name”: “MyApp”,
“version”: “0.0.1”,
“author”: “Ionic Framework”,
“homepage”: “https://ionicframework.com/”,
“scripts”: {
“ng”: “ng”,
“start”: “ng serve”,
“build”: “node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng build”,
“test”: “ng test”,
“lint”: “ng lint”,
“e2e”: “ng e2e”,
“cordova-rm”: “ionic cordova platform rm android”,
“cordova-add”: “ionic cordova platform add android@9.1.0 --no-resources”,
“cordova-build-debug”: “ionic cordova build android --prod”,
“cordova-build-release”: “ionic cordova build android --release --prod --stacktrace”
},
“private”: true,
“dependencies”: {
@angular/animations”: “^10.0.0”,
@angular/common”: “^10.0.0”,
@angular/core”: “^10.0.0”,
@angular/forms”: “^10.0.0”,
@angular/platform-browser”: “^10.0.0”,
@angular/platform-browser-dynamic”: “^10.0.0”,
@angular/router”: “^10.0.0”,
@ionic-native/app-launcher”: “^5.36.0”,
@ionic-native/app-version”: “^5.27.0”,
@ionic-native/camera”: “^5.31.1”,
@ionic-native/clipboard”: “^5.33.1”,
@ionic-native/core”: “^5.0.7”,
@ionic-native/device”: “^5.27.0”,
@ionic-native/file”: “^5.36.0”,
@ionic-native/file-transfer”: “^5.31.1”,
@ionic-native/fingerprint-aio”: “^5.33.0”,
@ionic-native/in-app-browser”: “^5.27.0”,
@ionic-native/insomnia”: “^5.27.0”,
@ionic-native/ionic-webview”: “^5.27.0”,
@ionic-native/mobile-accessibility”: “^5.27.0”,
@ionic-native/network”: “^5.27.0”,
@ionic-native/push”: “^5.27.0”,
@ionic-native/screen-orientation”: “^5.32.1”,
@ionic-native/sms-retriever”: “^5.29.0”,
@ionic-native/social-sharing”: “^5.31.1”,
@ionic-native/speech-recognition”: “^5.31.1”,
@ionic-native/splash-screen”: “^5.32.1”,
@ionic-native/sqlite”: “^5.27.0”,
@ionic-native/sqlite-porter”: “^5.27.0”,
@ionic-native/status-bar”: “^5.0.0”,
@ionic/angular”: “^5.8.1”,
@ionic/storage”: “^2.2.0”,
@ngx-translate/core”: “^13.0.0”,
@types/crypto-js”: “^3.1.47”,
@types/hammerjs”: “^2.0.36”,
“angular-code-input”: “^1.4.0”,
“aws-amplify”: “^3.3.15”,
“bufferutil”: “^4.0.1”,
“chart.js”: “^2.9.4”,
“cordova”: “^10.0.0”,
“cordova-clipboard”: “^1.3.0”,
“cordova-common”: “^4.0.2”,
“cordova-plugin-app-launcher”: “~0.4.0”,
“cordova-plugin-app-version”: “^0.1.9”,
“cordova-plugin-camera”: “^4.1.0”,
“cordova-plugin-device”: “^2.0.2”,
“cordova-plugin-fingerprint-aio”: “^3.0.1”,
“cordova-plugin-inappbrowser”: “^4.0.0”,
“cordova-plugin-insomnia”: “^4.3.0”,
“cordova-plugin-ionic-keyboard”: “^2.2.0”,
“cordova-plugin-iroot”: “^2.1.0”,
“cordova-plugin-network-information”: “^2.0.2”,
“cordova-plugin-screen-orientation”: “^3.0.2”,
“cordova-plugin-speechrecognition”: “^1.2.0”,
“cordova-plugin-splashscreen”: “^5.0.2”,
“cordova-plugin-statusbar”: “^2.4.2”,
“cordova-plugin-whitelist”: “^1.3.4”,
“cordova-plugin-x-socialsharing”: “^5.6.8”,
“cordova-sqlite-storage”: “^5.0.1”,
“cordova-support-google-services”: “^1.3.1”,
“crypto-js”: “^4.0.0”,
“cupertino-pane”: “^1.2.1”,
“es6-promise-plugin”: “^4.2.2”,
“hammerjs”: “^2.0.8”,
“ionic”: “^5.4.16”,
“ionic-pullup”: “^5.0.0-beta.3”,
“ionic2-calendar”: “^0.5.9”,
“ng-circle-progress”: “^1.6.0”,
“ng2-nvd3”: “^2.0.0”,
“ngx-socket-io”: “^3.2.0”,
“phonegap-plugin-mobile-accessibility”: “^1.0.5”,
“phonegap-plugin-multidex”: “^1.0.0”,
“phonegap-plugin-push”: “^2.3.0”,
“properties-parser”: “^0.3.1”,
“rxjs”: “^6.5.3”,
“rxjs-compat”: “^6.5.3”,
“socket.io-client”: “^2.3.1”,
“stream”: “0.0.2”,
“timers”: “^0.1.1”,
“tslib”: “^2.2.0”,
“typescript-string-operations”: “^1.3.3”,
“uk.co.workingedge.cordova.plugin.sqliteporter”: “^1.1.1”,
“utf-8-validate”: “^5.0.2”,
“utf8”: “^3.0.0”,
“zone.js”: “~0.10.2”
},
“devDependencies”: {
@angular-devkit/build-angular”: “^0.1100.7”,
@angular/cli”: “~10.0.5”,
@angular/compiler”: “^10.1.6”,
@angular/compiler-cli”: “^11.1.0”,
@angular/language-service”: “~10.0.0”,
@ionic/angular-toolkit”: “^4.0.0”,
@types/jasmine”: “~3.5.0”,
@types/jasminewd2”: “~2.0.3”,
@types/node”: “^12.11.1”,
@types/socket.io-client”: “^1.4.34”,
“codelyzer”: “^6.0.0”,
“cordova-android”: “^9.1.0”,
“cordova-clipboard”: “^1.3.0”,
“cordova-plugin-badge”: “^0.8.8”,
“cordova-plugin-ionic-webview”: “^4.2.1”,
“cordova-plugin-local-notification”: “^0.9.0-beta.2”,
“jasmine-core”: “~3.5.0”,
“jasmine-spec-reporter”: “~4.2.1”,
“karma”: “~5.0.0”,
“karma-chrome-launcher”: “~3.1.0”,
“karma-coverage-istanbul-reporter”: “~2.1.0”,
“karma-jasmine”: “~3.0.1”,
“karma-jasmine-html-reporter”: “^1.4.2”,
“protractor”: “~5.4.3”,
“ts-node”: “~8.3.0”,
“tslint”: “~6.1.0”,
“typescript”: “^4.0.5”
},
“browser”: {
“crypto”: false
},
“description”: “An Ionic project”,
“cordova”: {
“plugins”: {
“cordova-plugin-whitelist”: {},
“cordova-plugin-statusbar”: {},
“cordova-plugin-device”: {},
“cordova-plugin-splashscreen”: {},
“cordova-plugin-ionic-keyboard”: {},
“cordova-plugin-network-information”: {},
“cordova-plugin-app-version”: {},
“cordova-plugin-insomnia”: {},
“cordova-plugin-speechrecognition”: {},
“cordova-plugin-inappbrowser”: {},
“phonegap-plugin-mobile-accessibility”: {},
“phonegap-plugin-push”: {
“ANDROID_SUPPORT_V13_VERSION”: “27.+”,
“FCM_VERSION”: “17.0.+”
},
“cordova-sqlite-storage”: {},
“uk.co.workingedge.cordova.plugin.sqliteporter”: {},
“cordova-plugin-iroot”: {},
“cordova-plugin-x-socialsharing”: {
“ANDROID_SUPPORT_V4_VERSION”: “24.1.1+”
},
“cordova-plugin-file-transfer”: {},
“cordova-plugin-screen-orientation”: {},
“cordova-plugin-fingerprint-aio”: {},
“cordova-clipboard”: {},
“phonegap-plugin-multidex”: {},
“cordova-support-google-services”: {},
“cordova-plugin-camera”: {
“ANDROID_SUPPORT_V4_VERSION”: “27.+”
},
“cordova-plugin-app-launcher”: {},
“cordova-plugin-ionic-webview”: {
“ANDROID_SUPPORT_ANNOTATIONS_VERSION”: “27.+”
},
“cordova-plugin-local-notification”: {}
},
“platforms”: [
“android”
]
}
}