AppVersion on ionic 7

Hi,

I’m using the @awesome-cordova-plugins/app-version package to be able to output the package version of my app in an ionic7 project

I am making use of @awesome-cordova-plugins/app-version

but I get the error:

core.mjs:10162 ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(ConfigutionPageModule)[AppVersion -> AppVersion -> AppVersion -> AppVersion]:
   NullInjectorError: No provider for AppVersion!

I have AppVersion included in the providers of app.module.ts. What could this error be due to?

Thank you

have you tried to also include it in the module of the component your using it in?

I would suggest to use @capawesome/capacitor-app-update instead.

It provides a method to get the app version: getAppUpdateInfo() and also other useful methods.

1 Like

I already saw the problem.
I was not importing it correctly. Putting this, it has worked for me:

import { AppVersion } from ‘@awesome-cordova-plugins/app-version/ngx’;

Thanks!

1 Like