Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Required Software
Re-open the terminal so that npm command would become available and run:
*if facing any error for installing nvm export repo using below command
“export NVM_NODEJS_ORG_MIRROR=http://nodejs.org/dist”
nvm install 11
npm i -g cordova
“cordova –version”
The next thing necessary for Cordova/Android development is JDK. Installation command
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.
el7_6.x86_64
*Please check the correct java version installed.
The changes in .bash_profile do not take place immediately, and to apply them, you need to
reconnect to the server or run source ~/.bash_profile.
Gradle is a build-automation system which is necessary for making Android builds. In order to install
Gradle, we need to download it first
wget https://services.gradle.org/distributions/gradle-5.1-bin.zip
*Install Gradle with certificate only else may get java error later.
mkdir /opt/gradle
unzip -d /opt/gradle gradle-5.1-bin.zip
PATH=$PATH:$HOME/bin:/opt/gradle/gradle-5.1/bin
source ~/.bash_profile
gradle -v
Download the latest Android Command Line tools . Do not download Android Studio, scroll to
command line tools only.
wget https://dl.google.com/android/repository/sdk-tools-linux-433
3796.zip
mkdir -p /opt/android
Move the archive to /opt/android (so that it is available under /opt/android/tools), unzip it in there,
and add to the $PATH environment variable /opt/android/tools and /opt/android/tools/bin.
android, sdkmanager, and other CLI commands should become available, but note that they would
work only if you set $JAVA_HOME environment variable correctly.
PATH=$PATH:$HOME/bin:/opt/android/tools:/opt/android/tools/bin:/o
pt/gradle/gradle-5.1/bin
sdkmanager --list
Among the list, we'd need the latest version of build tools and platform-tools, as well as Google Play
Services – if you use their features such as push notifications. To install Google Play Services, run:
The script will start downloading the updates. Accept the license agreement and wait till installation
finishes.
If you run sdkmanager --list once again, you will see the installed packages at the beginning of the
output. And just in case, If you received Warning: File /root/.android/repositories.cfg could not be
loaded when trying to use sdkmanager, run touch ~/.android/repositories.cfg.
export ANDROID_HOME=/opt/android
So now we are ready to go.The first Android build would take some time, but the subsequent ones
will finish much faster.
Step8: Check all the cordova requirements are installed .Use below command
“cordova requirements”