Ionic 2 native file api : not reconized


#1

I am trying to save a file on the device. I try to install the file native on ionic 2 using this command line.
ionic plugin add --save cordova-plugin-file
When i try to import it:
import { File } from ‘@ionic-native/file’;
the app show me this error


[11:50:08]  typescript: C:/Users/path/node_modules/@ionic-native/file/index.d.ts, line: 533
            Type 'any' is not a constructor function type.

     L533:  export declare class File extends IonicNativePlugin {

how can i resolve this problem ?


#2

Are you certain you did all of the steps described in the docs?


#3

i reinstall the ionic native
npm install @ionic-native/core --save
. then i was able to install plugins.
i am not sure why this behavior specially i had worked with ionic native in the same project.


#4

I think he is referring more to this last paragraph:
https://ionicframework.com/docs/native/#Add_Plugins_to_Your_App_Module


#5

i don’t think so. i always add the plugin to ngmodule.