Ionic-native/core not updating


#1

I’ve been having a problem with ionic-native’s file in terms of using resolveLocalFileSystemURL. Reading up, it seems like maybe I need to update my ionc-native core. I put “@ionic-native/core”: “^4.3.3” in my package.json, nuke my node_modules and run npm install. It seems to installing fine, but when I go to test, I see:

Typescript Error
Property ‘resolveLocalFileSystemURL’ does not exist on type ‘File’.
src/pages/tasks/tasks.ts
//(this.file as any).resolveLocalFileSystemURL(this.fileURI,
this.file.resolveLocalFileSystemURL(this.fileURI,
function(fileEntry) {
Ionic Framework: 2.0.0
Ionic Native: 2.8.1
Ionic App Scripts: 1.1.4
Angular Core: 2.2.1
Angular Compiler CLI: 2.2.1
Node: 6.9.1
OS Platform: macOS Sierra
Navigator Platform: MacIntel
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

Am I missing something?


#2

I had similar problems the other day, make sure that you have all the right packages installed. Check your package.json.

Any dependencies prefixed with @angular/… should have the same version number. Example:

    "@angular/common": "4.4.4",
    "@angular/compiler": "4.4.4",
    "@angular/compiler-cli": "4.4.4",
    "@angular/core": "4.4.4",
    "@angular/forms": "4.4.4",
    "@angular/http": "4.4.4",
    "@angular/platform-browser": "4.4.4",
    "@angular/platform-browser-dynamic": "4.4.4",

Any dependencies prefixed with @ionic-native should have the same version number. Example:

    "@ionic-native/geolocation": "^4.3.0",
    "@ionic-native/google-analytics": "^4.3.0",
    "@ionic-native/keyboard": "^4.3.0",
    "@ionic-native/launch-navigator": "^4.3.0",
    "@ionic-native/onesignal": "^4.3.0",
    "@ionic-native/splash-screen": "4.3.0",
    "@ionic-native/status-bar": "4.3.0",

Furthermore, when I did a large-leap upgrade (3.3 to 3.8 yesterday) I followed the CHANGELOG found on the official ionic package. It looks like you have a LOT of packages that are out of date (app-scripts, angular core, to start). I hope you saved your node_modules, I was able to upgrade mine without nuking them.

See changelog here: https://github.com/ionic-team/ionic/blob/master/CHANGELOG.md