Ionic 3 error install native plugin after Ionic 4 release

前端 未结 4 1731
Happy的楠姐
Happy的楠姐 2021-01-03 02:04

I get a problem using native plugin ionic 3 when install Native Store is success, but when I try to add in app module, the text editor show a red line and when I try to run

相关标签:
4条回答
  • 2021-01-03 02:29

    For those that end here running on Ionic 5 just fix your import statement from:

    import { BarcodeScanner } from ‘@ionic-native/barcode-scanner’;

    to:

    import { BarcodeScanner } from ‘@ionic-native/barcode-scanner/ngx’;

    Otherwise the above work for Ionic 3.9x and Ionic 4.xx

    0 讨论(0)
  • 2021-01-03 02:34

    Try To Find .. Second Last Previous Version of Plugin & Append While Adding Plugin

    npm install @ionic-native/native-storage@4.19.0
    

    Here... Latest Version is 5.0.0 So Add @4.19.0 Please Don't Make Assumption Based On
    Number Go In Repo or npm link try to find our previous version then append.

    Then do your All Step Regularly.

    Thanks

    0 讨论(0)
  • 2021-01-03 02:34

    Goto https://www.npmjs.com.

    Search for the ionic-native package that you want to install.

    In your case, its 'ionic-native-storage'. Check the versions and choose the one which was released before the Ionic 4 Beta release and then install the appropriate version using the same command.

    ionic cordova plugin add cordova-plugin-nativestorage@"====add your version here===="
    

    After that the plugin will work the same way as it did. No need to fiddle with adding 'ngx' at the end of the path.

    0 讨论(0)
  • 2021-01-03 02:35

    All your @ionic-native modules now need /ngx at the end for Angular projects. Just fix it like this:

    import { NativeStorage } from '@ionic-native/native-storage/ngx';
    

    Apply this to every @ionic-native plugin/module.

    0 讨论(0)
提交回复
热议问题