Issues building for Android Target 30

Hi,

I’m hoping someone can help me with this. Play Store now requires target 30, so I’ve done the below,

ionic cordova plugin rm cordova-plugin-whitelist
ionic cordova plugin rm cordova-plugin-androidx
ionic cordova platform remove android
ionic cordova platform add android@latest

and updated the config.xml

<preference name="android-targetSdkVersion" value="30" />
<preference name="AndroidXEnabled" value="true" />

now it builds and runs fine using debug.

The issue comes when I build for release and immediately I get

Application Error - net:ERR_CONNECTION_REFUSED (https://localhost/index.html).

logcat

11-12 14:35:01.213 18385 18385 D CordovaWebViewImpl: onPageDidNavigate(https://localhost/index.html)
11-12 14:35:01.213 18385 18385 D PluginManager: postMessage: onPageStarted
11-12 14:35:01.213  1009  1057 D ArtManagerInternalImpl: /data/misc/iorapd/uk.co.myappl/21300/uk.co.myapp.MainActivity/compiled_traces/compiled_trace.pb doesn't exist
11-12 14:35:01.213 18385 18385 D SystemWebViewClient: CordovaWebViewClient.onReceivedError: Error code=-6 Description=net::ERR_CONNECTION_REFUSED URL=https://localhost/index.html
11-12 14:35:01.213 18385 18385 D PluginManager: postMessage: onReceivedError
11-12 14:35:01.218   629   643 E BufferQueueProducer: [uk.co.myapp/uk.co.myapp.MainActivity$_18385#1](id:27500000837,api:0,p:-1,c:629) disconnect: not connected (req=1)
11-12 14:35:01.218 18385 21825 W libEGL  : EGLNativeWindowType 0x785a65ca50 disconnect failed
11-12 14:35:01.218 18385 18385 D ViewRootImpl@d13f57c[MainActivity]: dispatchDetachedFromWindow: reset blurmask
11-12 14:35:01.218   629   643 E SurfaceFlinger: Permission Denial: can't read framebuffer pid=18385, uid=10691

I’m not sure what to do next to resolve this? Any help appreciated.

My dependencies,

 "dependencies": {
    "@angular/animations": "^11.2.14",
    "@angular/common": "^11.2.14",
    "@angular/core": "^11.2.14",
    "@angular/forms": "^11.2.14",
    "@angular/platform-browser": "^11.2.14",
    "@angular/platform-browser-dynamic": "^11.2.14",
    "@angular/pwa": "^0.900.7",
    "@angular/router": "^11.2.14",
    "@angular/service-worker": "^11.2.14",
    "@ionic-native/barcode-scanner": "^5.36.0",
    "@ionic-native/core": "^5.36.0",
    "@ionic-native/device": "^5.36.0",
    "@ionic-native/in-app-browser": "^5.36.0",
    "@ionic-native/splash-screen": "^5.36.0",
    "@ionic-native/status-bar": "^5.36.0",
    "@ionic-native/stripe": "^5.36.0",
    "@ionic/angular": "^5.8.5",
    "@ionic/storage": "^2.3.1",
    "@swimlane/ngx-datatable": "^17.1.0",
    "@types/file-saver": "^2.0.3",
    "@types/leaflet": "^1.7.5",
    "angular2-uuid": "^1.1.1",
    "bootstrap": "4.4.1",
    "confetti-js": "0.0.18",
    "cordova-android": "10.1.1",
    "cordova-ios": "5.1.1",
    "cordova-plugin-add-swift-support": "^2.0.2",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-inappbrowser": "^3.2.0",
    "cordova-plugin-wkwebview-engine": "^1.2.2",
    "core-js": "^3.19.1",
    "file-saver": "^2.0.2",
    "flatpickr": "^4.6.9",
    "google-libphonenumber": "^3.2.25",
    "intl-tel-input": "^17.0.13",
    "ionic-plugin-deeplinks": "1.0.20",
    "leaflet": "^1.7.1",
    "moment": "^2.29.1",
    "ng2-file-upload": "^1.4.0",
    "ng2-simple-timer": "^8.2.2",
    "ngx-bootstrap": "^6.2.0",
    "ngx-device-detector": "^1.5.2",
    "ngx-intl-tel-input": "^3.1.1",
    "phonegap-plugin-barcodescanner": "^8.1.0",
    "qr-creator": "^1.0.0",
    "rxjs": "6.5.4",
    "uuid": "^3.4.0",
    "zone.js": "^0.10.3"
  },
  "devDependencies": {
    "@angular-devkit/architect": "^0.1102.15",
    "@angular-devkit/build-angular": "^0.1102.15",
    "@angular-devkit/core": "^11.2.15",
    "@angular-devkit/schematics": "^11.2.15",
    "@angular-eslint/builder": "1.2.0",
    "@angular-eslint/eslint-plugin": "1.2.0",
    "@angular-eslint/eslint-plugin-template": "1.2.0",
    "@angular-eslint/schematics": "1.2.0",
    "@angular-eslint/template-parser": "1.2.0",
    "@angular/cli": "11.2.10",
    "@angular/compiler": "^11.2.14",
    "@angular/compiler-cli": "^11.2.14",
    "@angular/language-service": "^11.2.14",
    "@ionic/angular-toolkit": "^3.1.1",
    "@types/jasmine": "^3.10.2",
    "@types/jasminewd2": "^2.0.10",
    "@types/node": "^13.13.52",
    "@typescript-eslint/eslint-plugin": "4.3.0",
    "@typescript-eslint/parser": "4.3.0",
    "codelyzer": "^6.0.2",
    "cordova-plugin-androidx-adapter": "^1.1.3",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^2.5.3",
    "cordova-plugin-splashscreen": "^5.0.4",
    "cordova-plugin-statusbar": "^2.4.3",
    "eslint": "^7.32.0",
    "eslint-plugin-import": "2.22.1",
    "eslint-plugin-jsdoc": "30.7.6",
    "eslint-plugin-prefer-arrow": "1.2.2",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.7.0",
    "protractor": "~7.0.0",
    "ts-node": "~8.6.2",
    "typescript": "^4.1.6"
  },
  "description": "My Application",
  "cordova": {
    "plugins": {
      "cordova-plugin-statusbar": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-device": {},
      "phonegap-plugin-barcodescanner": {
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      },
      "cordova-plugin-androidx-adapter": {}
    },
    "platforms": [
      "ios",
      "android"
    ]
  }
}

Progressed after making a default cordova project,

ionic start cordovaApp tabs --type=angular --cordova

and copying all the main scaffolding files over.