@nativescript/imagepicker - TypeError: Cannot read properties of null (reading 'getName') on Android when picking a photo

69 Views Asked by At

I've migrated from https://www.npmjs.com/package/nativescript-mediafilepicker to @nativescript/imagepicker and having issues with it on Android platform when picking images. Below is my config

Packages:

"dependencies": {
    "@angular/animations": "^15.2.0",
    "@angular/common": "^15.2.0",
    "@angular/compiler": "^15.2.0",
    "@angular/core": "^15.2.0",
    "@angular/forms": "^15.2.0",
    "@angular/platform-browser": "^15.2.0",
    "@angular/platform-browser-dynamic": "^15.2.0",
    "@angular/router": "^15.2.0",
    "@nativescript-community/universal-links": "^3.0.0",
    "@nativescript/angular": "^15.2.0",
    "@nativescript/appversion": "~2.0.0",
    "@nativescript/background-http": "^6.0.0",
    "@nativescript/core": "~8.5.0",
    "@nativescript/datetimepicker": "^2.1.11",
    "@nativescript/email": "^2.0.5",
    "@nativescript/imagepicker": "^2.0.1",
    "@nativescript/iqkeyboardmanager": "^2.1.1",
    "@nativescript/social-share": "^2.0.4",
    "@nativescript/theme": "~3.0.2",
    "@nota/nativescript-webview-ext": "^8.0.2",
    "@nstudio/nativescript-barcodescanner": "^5.0.1",
    "crypto-js": "^4.1.1",
    "eslint": "^7.25.0",
    "nativescript-phone": "^3.0.3",
    "nativescript-plugin-universal-links": "^2.0.0",
    "nativescript-ui-gauge": "^15.2.3",
    "nativescript-ui-listview": "^15.2.3",
    "nativescript-ui-sidedrawer": "^15.2.3",
    "reflect-metadata": "~0.1.12",
    "rxjs": "~7.5.0",
    "shelljs": "^0.8.4",
    "zone.js": "~0.11.5"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^15.2.5",
    "@angular/compiler-cli": "^15.2.0",
    "@nativescript/android": "~8.5.0",
    "@nativescript/ios": "~8.5.1",
    "@nativescript/types": "~8.5.0",
    "@nativescript/webpack": "~5.0.14",
    "@ngtools/webpack": "^15.2.5",
    "codelyzer": "~6.0.0",
    "sass": "^1.49.9",
    "semver": "^7.3.4",
    "typescript": "^4.9.4",
    "url-parse": "^1.5.10"
  }

ns info:

Getting NativeScript components versions information...
✔ Component nativescript has 8.5.3 version and is up to date.
✔ Component @nativescript/core has 8.5.3 version and is up to date.
✔ Component @nativescript/ios has 8.5.1 version and is up to date.
✔ Component @nativescript/android has 8.5.0 version and is up to date.

Component code:

And lastly the error - TypeError: Cannot read properties of null (reading 'getName')

Works as expected on iOS

0

There are 0 best solutions below