Packages update

Yesterday, I’ve decided to resolve my project vulnerabilities with ‘npm audit’ and ‘npm audit fix’.

image

package.json

  "name": "PersaxApp",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~10.0.5",
    "@angular/cdk": "~10.1.0",
    "@angular/common": "~10.0.5",
    "@angular/core": "~10.0.5",
    "@angular/forms": "~10.0.5",
    "@angular/material": "^10.1.0",
    "@angular/platform-browser": "~10.0.5",
    "@angular/platform-browser-dynamic": "~10.0.5",
    "@angular/router": "~10.0.5",
    "@auth0/angular-jwt": "^5.0.1",
    "@capacitor/android": "^2.3.0",
    "@capacitor/core": "2.3.0",
    "@ionic-native/core": "^5.27.0",
    "@ionic-native/splash-screen": "^5.27.0",
    "@ionic-native/status-bar": "^5.27.0",
    "@ionic/angular": "^5.3.0",
    "@ionic/storage": "^2.3.0",
    "core-js": "^3.6.5",
    "jetifier": "^1.6.6",
    "ngx-bootstrap": "^5.6.1",
    "rxjs": "~6.6.0",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.1000.4",
    "@angular/cli": "~10.0.4",
    "@angular/compiler": "~10.0.5",
    "@angular/compiler-cli": "^10.0.5",
    "@angular/language-service": "~10.0.5",
    "@capacitor/cli": "2.3.0",
    "@ionic/angular-toolkit": "^2.3.0",
    "@types/jasmine": "~3.5.11",
    "@types/jasminewd2": "~2.0.8",
    "@types/node": "~14.0.25",
    "codelyzer": "^6.0.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.2",
    "karma": "^5.1.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.3",
    "karma-jasmine": "~3.3.1",
    "karma-jasmine-html-reporter": "^1.5.4",
    "protractor": "^7.0.0",
    "ts-node": "~8.10.2",
    "tslint": "~6.1.2",
    "typescript": "~3.9.7"
  },
  "description": "An Ionic project"
}

So I’ve installed npm install jetifier; npx jetify.

On my Android project I’ve added

gradle.properties

org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
android.enableJetifier=true

AndroidManifest.xml

<provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths"></meta-data>
 </provider>

Finally, I can execute my app on my device but now Notification Push doesn’t work. I’m using Capacitor and I followed this guide (https://capacitorjs.com/docs/guides/push-notifications-firebase). Before update worked fine. Can I undo AndroidX change?

If anyone could help me.

You shouldn’t have needed to use jetify if you’re using the latest capacitor releases. They should already have support for Android X.