Natives Plugs Inns in Ionic 4

Anyone can help, I’m trying to use some plugs inns in Ionic 4 but doesn’t work, I try with Camera, Facebook, Google and more but doesn’t work, I follow the Ionic Documentation and apparently everything is correct but when I run the App show an error and not show anything.

I realize that only when I import the plugins in the app.module.ts is when fail, and I try many Native PlugInns and all don’t work. when I take off the Imports in app.modules.ts the App work again (of course without the plugins)

i use a few plugins here, see source code and notes in readme

Things to notice in the code

// notice the path for the import ends in ngx
import { Camera, CameraOptions } from "@ionic-native/camera/ngx";
import { File } from "@ionic-native/file/ngx";

you have to do the same when you import the module in app.module.ts

import { Camera } from '@ionic-native/camera/ngx';
import { File } from '@ionic-native/file/ngx';

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
  providers: [
    File,
    Camera,
    StatusBar,
    SplashScreen,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

and the use of the beta versions of the ionic/native

    "@ionic-native/camera": "^5.0.0-beta.15",
    "@ionic-native/core": "^5.0.0-beta.17",
    "@ionic-native/file": "5.0.0-beta.15",
    "@ionic-native/splash-screen": "5.0.0-beta.15",
    "@ionic-native/status-bar": "5.0.0-beta.15",

Hi, Thanks for your reply.
but the difference of your code and mine is this: you put
import { Camera } from ‘@ionic-native/camera/ngx’;
and I put
import { Camera } from '@ionic-native/camera;
as you can see I miss the ngx, but when I put the ngx show me an error.
I think is I’m missing something to install that make Ionic don’t recognize the ngx, but I dont know what could be.
You know, what could be?

the project that i linked to can be downloaded an run to see what other issues there are… i suspect you dont have the beta versions of the plugins… compare your package.json to the project provided

1 Like

thanks, Yes you are right I dont have the beta version for that pluginss… but How can I get or install?
I already try to reinstall, also I generate new proyect and install the pluggin but always install de version 4.12.2 no the ": “^5.0.0-beta.15”, ,
Some Help?

Install a specific version of a plugin :

example : status-bar version 5.0.0-beta.17

npm install --save @ionic-native/status-bar@5.0.0-beta.17

For ionic-native plugin, I think you need to update also core plugin ?
npm install --save @ionic-native/core@5.0.0-beta.17

there is a link to a complete project above, if you look at the package.json and update the version numbers to match what I have, then run npm update you should be good to go