Ionic4 beta - AppVersion plugin

Getting an error when using the @ionic-native/app-version plugin with Ionic4 Beta.

Object(…) is not a function --> index.js

Using these…

In app.module.ts
import{ AppVersion } from '@ionic-native/app-version;
providers: […AppVersion…]

The same code is working fine in ionic3

Interesting that you elide the very dependency that is giving you problems: @ionic-native/app-version itself. I’m going to speculate that it’s <v5.

Have basically followed the instructions as in

have updated bug description as well. Same code works fine in Ionic3

  • Open the search feature of the forum
  • Enter your error “Object(…) is not a function”
  • Click one of the previous post
  • Find the solution

It’s not a bug. It’s pilot error. As I suspected, @ionic-native/app-version is <v5. All the ionic native stuff has to be on the same major version.

yup… upgraded to version 5

corrected import statement as well
import {AppVersion} from ‘@ionic-native/app-version/ngx’;

Thanks for the tip.