How do I setup the environment to work with Ionic and Cordova?


#1

How do I setup the environment to work with Ionic and Cordova? Follow the to the official website does not work (gives error “Cordova is not available” when i use --livereload) … my clients are already furious, please help me!


#2

Cordova is only accessible via cell. Are you referring to accessing plugins via desktop/laptop? If so, it’s not possible.


#3

Im acessing via Emulator and Cell


#4

print your ionic info for me to try to do the same, please


#5

@jaydz

On a new computer, I installed:

  • Java
  • Ant
  • Andrioid Studio
  • NodeJs
  • Ionic and Cordova (npm install -g cordova ionic)

And after everything configured just like the Ionic documents, I created a new basic app:

ionic start myApp tabs

The application even runs normally, but when I go to debug:

ionic cordova run android -lc

I get the following message:

console.warn: Native: tried calling StatusBar.styleDefault, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
console.warn: Native: tried calling SplashScreen.hide, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator

Did I forget to do something?


#6

I don’t have experience working with emulators aside from Android Studio. So in terms of Ionic and emulators, I have no input.

The warnings you received are par for the course when debugging in the browser though. You didn’t do anything wrong, and every other person that debugs Ionic in the browser receives the same warning.

If your client expects you to change that, they need to be willing to pay you a billion dollars, as you’d have performed a genuine miracle in the process.


#7
cli packages: (C:\NVM\nvm-noinstall\v8.5.0\node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 3.1.7
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v8.5.0
    npm  : 5.3.0
    OS   : Windows 10

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

#8

@jaydz

put command cordova requirements … please…


#9

hey @marciusbezerra,

if you are using windows system then follow these instructions :-

  1. Download and Install node.js from Here

  2. After successfull installation run this command in cmd node --version , this gives you the version of your node.js installed in your system

  3. After that run these command in cmd (cmd run as administrator)

    • npm install -g cordova
    • npm install -g ionic
  4. Download and install JDK from Here

  5. Download and Install android studio from Here

  6. Open computer properties -> Advance System Setting -> Environment Variables

  7. In system variables Add New Variable JAVA_HOME and path of your java -> jdk -> bin

  8. In system variables Add New Variable ANDROID_HOME and path of your Android SDK


#10

and finally from your ionic project, windows/lin/mac terminal run, ionic serve
in the android case, ionic cordova run android (assuming you have an android phone, plugged by usb, to the development workstation).