# How to get simply app version?

**URL:** <https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210>\
**Category:** ionic-v3\
**Created:** [April 20, 2017, 10:18am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210 "2017-04-20T10:18:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arulmano](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/arulmano/32/107323_2.png) [@Arulmano](https://forum.ionicframework.com/u/Arulmano)\
**Post date:** [April 20, 2017, 10:18am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/1 "2017-04-20T10:18:44Z")

</div>

how to get app version ?  
install native plugin getting back error in ionic/native

---

<div class="post-metadata">

**Author:** ![LoLStats](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lolstats/32/103165_2.png) [@LoLStats](https://forum.ionicframework.com/u/LoLStats)\
**Post date:** [April 20, 2017, 10:44am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/2 "2017-04-20T10:44:48Z")

</div>

You can store the App version in a separate JSON file in your assets folder.

```auto
{ "version": "1.0.0" }

```

Thats it 🙂

---

<div class="post-metadata">

**Author:** ![cherylhanlon](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@cherylhanlon](https://forum.ionicframework.com/u/cherylhanlon)\
**Post date:** [April 20, 2017, 10:46am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/3 "2017-04-20T10:46:32Z")

</div>

You need to provide more information about what you have tried and not tried and what version of ionic native you are using.

Also providing the actual error message would help.

Are you talking about setting the version number or reading it out ?

To read it out, mine works using the latest version of ionic native.

I imported like so  
import { AppVersion } from ‘@ionic-native/app-version’;

In my constructor I injected the dependency  
constructor(private appVersion: AppVersion)

Then I got the app version like this

this.appVersion.getVersionNumber().then(version =\> {  
this.versionNumber = version;  
});

I also had to add appversion to my providers in my app.module.ts

---

<div class="post-metadata">

**Author:** ![Arulmano](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/arulmano/32/107323_2.png) [@Arulmano](https://forum.ionicframework.com/u/Arulmano)\
**Post date:** [April 20, 2017, 10:46am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/4 "2017-04-20T10:46:42Z")

</div>

please give me a full example…

i gave verion:1.1.1 in config.xml but couldn’t get the version in login form… what to do?

---

<div class="post-metadata">

**Author:** ![Arulmano](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/arulmano/32/107323_2.png) [@Arulmano](https://forum.ionicframework.com/u/Arulmano)\
**Post date:** [April 20, 2017, 10:47am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/5 "2017-04-20T10:47:19Z")

</div>

i’m also do this. but error in native/core

---

<div class="post-metadata">

**Author:** ![cherylhanlon](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@cherylhanlon](https://forum.ionicframework.com/u/cherylhanlon)\
**Post date:** [April 20, 2017, 10:47am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/6 "2017-04-20T10:47:44Z")

</div>

What version of ionic are you use and what is the exact error message

---

<div class="post-metadata">

**Author:** ![Arulmano](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/arulmano/32/107323_2.png) [@Arulmano](https://forum.ionicframework.com/u/Arulmano)\
**Post date:** [April 20, 2017, 10:48am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/7 "2017-04-20T10:48:50Z")

</div>

this.appVersion.getVersionNumber().then(version =\> {  
this.versionNumber = version;  
});

i’m using this code. but when i run my app getting error … it said runtime error  
native/core

---

<div class="post-metadata">

**Author:** ![LoLStats](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lolstats/32/103165_2.png) [@LoLStats](https://forum.ionicframework.com/u/LoLStats)\
**Post date:** [April 20, 2017, 10:49am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/8 "2017-04-20T10:49:20Z")

</div>

With my method ou have to access the JSON file with an HTTP get request.

`http.get('assets/appversioon.json')...`

If you want to use the native plugin, you can test it only on your device and not in your browser. This is your mistake.

---

<div class="post-metadata">

**Author:** ![Arulmano](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/arulmano/32/107323_2.png) [@Arulmano](https://forum.ionicframework.com/u/Arulmano)\
**Post date:** [April 20, 2017, 10:50am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/9 "2017-04-20T10:50:39Z")

</div>

\<?xml version='1.0' encoding='utf-8'?\>

widget id=“com.ionicframework.eattendance” version=“1.1.0” xmlns=“[http://www.w3.org/ns/widgets](http://www.w3.org/ns/widgets)” xmlns:cdv=“[http://cordova.apache.org/ns/1.0](http://cordova.apache.org/ns/1.0)”\>  
Employee Attendance  
Employee Attendance Application

how to get this version. it’s under the folder is www/config.xml

---

<div class="post-metadata">

**Author:** ![Arulmano](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/arulmano/32/107323_2.png) [@Arulmano](https://forum.ionicframework.com/u/Arulmano)\
**Post date:** [April 20, 2017, 10:53am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/10 "2017-04-20T10:53:09Z")

</div>

Runtime Error  
Cannot find module “@ionic-native/core”

i’m using constructor(private appVersion: AppVersion) getting above error

Runtime Error  
Cannot find module "@ionic-native/core"  
Stack  
Error: Cannot find module "@ionic-native/core"  
at Object. ([http://localhost:8100/build/main.js:114239:7](http://localhost:8100/build/main.js:114239:7))  
at **webpack\_require** ([http://localhost:8100/build/main.js:20:30](http://localhost:8100/build/main.js:20:30))  
at Object. ([http://localhost:8100/build/main.js:26686:84](http://localhost:8100/build/main.js:26686:84))  
at **webpack\_require** ([http://localhost:8100/build/main.js:20:30](http://localhost:8100/build/main.js:20:30))  
at Object. ([http://localhost:8100/build/main.js:103748:77](http://localhost:8100/build/main.js:103748:77))  
at **webpack\_require** ([http://localhost:8100/build/main.js:20:30](http://localhost:8100/build/main.js:20:30))  
at Object. ([http://localhost:8100/build/main.js:92442:73](http://localhost:8100/build/main.js:92442:73))  
at **webpack\_require** ([http://localhost:8100/build/main.js:20:30](http://localhost:8100/build/main.js:20:30))  
at Object. ([http://localhost:8100/build/main.js:114227:70](http://localhost:8100/build/main.js:114227:70))  
at **webpack\_require** ([http://localhost:8100/build/main.js:20:30](http://localhost:8100/build/main.js:20:30))  
Ionic Framework: 2.1.0  
Ionic Native: ^2.4.1  
Ionic App Scripts: 1.1.3  
Angular Core: 2.2.1  
Angular Compiler CLI: 2.2.1  
Node: 6.9.1  
OS Platform: Windows 10  
Navigator Platform: Win32  
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)

---

<div class="post-metadata">

**Author:** ![cherylhanlon](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@cherylhanlon](https://forum.ionicframework.com/u/cherylhanlon)\
**Post date:** [April 20, 2017, 12:52pm UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/11 "2017-04-20T12:52:19Z")

</div>

You still haven’t told us what version of ionic you are using. Type ionic info in and post the results.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [April 20, 2017, 3:14pm UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/12 "2017-04-20T15:14:04Z")

</div>

> [@Arulmano](#):
>
> Ionic Native: ^2.4.1

This says you are using Ionic Native 2.x.

> [@Arulmano](#):
>
> Error: Cannot find module “@ionic-native/core”

But this module is part of Ionic Native 3.x.

Please post your `package.json`.

You will probably want to remove everything that has to do with Ionic Native and then follow these instructions:

[https://ionicframework.com/docs/native/](https://ionicframework.com/docs/native/) (all of them, also at the bottom!)  
[https://ionicframework.com/docs/native/app-version/](https://ionicframework.com/docs/native/app-version/)

---

<div class="post-metadata">

**Author:** ![Arulmano](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/arulmano/32/107323_2.png) [@Arulmano](https://forum.ionicframework.com/u/Arulmano)\
**Post date:** [April 21, 2017, 4:04am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/13 "2017-04-21T04:04:10Z")

</div>

PS D:\Arul MaNo\Ionic2\EAttendanceApp\> ionic info

Your system information:

ordova CLI: 6.5.0  
Ionic Framework Version: 2.0.0-rc.1  
Ionic CLI Version: 2.1.12  
Ionic App Lib Version: 2.1.7  
Ionic App Scripts Version: 0.0.36  
ios-deploy version: Not installed  
ios-sim version: Not installed  
OS: Windows 10  
Node Version: v6.9.1  
Xcode version: Not installed

---

<div class="post-metadata">

**Author:** ![Arulmano](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/arulmano/32/107323_2.png) [@Arulmano](https://forum.ionicframework.com/u/Arulmano)\
**Post date:** [April 21, 2017, 4:05am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/14 "2017-04-21T04:05:35Z")

</div>

```auto
{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "4.0.0",
    "@angular/compiler": "4.0.0",
    "@angular/compiler-cli": "4.0.0",
    "@angular/core": "4.0.0",
    "@angular/forms": "4.0.0",
    "@angular/http": "4.0.0",
    "@angular/platform-browser": "4.0.0",
    "@angular/platform-browser-dynamic": "4.0.0",
    "@ionic-native/background-geolocation": "^3.5.0",
    "@ionic-native/core": "3.4.2",
    "@ionic-native/geolocation": "^3.5.0",
    "@ionic-native/splash-screen": "3.4.2",
    "@ionic-native/sqlite": "^3.5.0",
    "@ionic-native/status-bar": "3.4.2",
    "@ionic/storage": "2.0.1",
    "ionic-angular": "3.0.1",
    "ionicons": "3.0.0",
    "rxjs": "5.1.1",
    "sw-toolbox": "3.4.0",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.0",
    "typescript": "~2.2.1"
  },
  "cordovaPlugins": [
    "cordova-plugin-whitelist",
    "cordova-plugin-statusbar",
    "cordova-plugin-console",
    "cordova-plugin-device",
    "cordova-plugin-splashscreen",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": [],
  "description": "EAttendanceApp: An Ionic project"
}

```

how to update my ionic native 2.x to 2.4.1

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [April 21, 2017, 9:43am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/15 "2017-04-21T09:43:19Z")

</div>

According to this `package.json` there is no need for this any more, this looks good. Now only follow the two links I posted to install the plugin needed to output the app version.

---

<div class="post-metadata">

**Author:** ![Taehwa](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/taehwa/32/95051_2.png) [@Taehwa](https://forum.ionicframework.com/u/Taehwa)\
**Post date:** [July 6, 2017, 9:11am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/16 "2017-07-06T09:11:27Z")

</div>

For ionic2/3  
Check here

[https://learnionic2.com/2017/04/04/getting-app-version-ionic-2-application/](https://learnionic2.com/2017/04/04/getting-app-version-ionic-2-application/)

---

<div class="post-metadata">

**Author:** ![AlGantori](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@AlGantori](https://forum.ionicframework.com/u/AlGantori)\
**Post date:** [April 26, 2018, 4:27am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/17 "2018-04-26T04:27:28Z")

</div>

Are you incrementing **appversion.json** , via a script? Could you please share the script.  
and how you include the script into every “ionic cordova build …” process?  
Thank you.

---

<div class="post-metadata">

**Author:** ![ipsjolly](https://avatars.discourse-cdn.com/v4/letter/i/5f9b8f/32.png) [@ipsjolly](https://forum.ionicframework.com/u/ipsjolly)\
**Post date:** [January 9, 2019, 8:37am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/18 "2019-01-09T08:37:43Z")

</div>

**For Ionic 4 and 3** Install App version native Plugin

**[Step by Step Tutorial](https://www.freakyjolly.com/ionic-4-get-app-version-name-version-code-and-package-name-using-ionic-native-plugin/)** for Ionic 4 but you can following Ionic 3 as well

```
this.appVersion.getVersionNumber().then(value => {
  this.AppVersionNumber = value;
}).catch(err => {
  alert(err);
});
```

---

<div class="post-metadata">

**Author:** ![Ferozabdul](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ferozabdul/32/121856_2.png) [@Ferozabdul](https://forum.ionicframework.com/u/Ferozabdul)\
**Post date:** [December 11, 2019, 6:57am UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/19 "2019-12-11T06:57:51Z")

</div>

this method not working on production build.

---

<div class="post-metadata">

**Author:** ![EinfachHans](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/einfachhans/32/130917_2.png) [@EinfachHans](https://forum.ionicframework.com/u/EinfachHans)\
**Post date:** [December 15, 2019, 7:14pm UTC](https://forum.ionicframework.com/t/how-to-get-simply-app-version/87210/20 "2019-12-15T19:14:46Z")

</div>

This should be the accepted answer
