Cordova build process for Android

16
March 15, 2019, at 06:30 AM

I started learning Ionic, created an app, run it on browser and android emulator. Everything seems fine. I'm just curious about a few things but unfortunately couldn't find anything specific on them.

When I run the command ionic cordova build android, following lines appear on the console -

> ionic-app-scripts build --target cordova --platform android
[13:16:50]  ionic-app-scripts 3.2.1
(--- SOME MORE LINES ---)
> cordova build android
Android Studio project detected
ANDROID_HOME=C:\Users\atiyar\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_202
studio
Welcome to Gradle 4.10.1!
Here are the highlights of this release:
(--- SOME MORE LINES ---)
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :wrapper
BUILD SUCCESSFUL in 1m 20s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
Downloading https://services.gradle.org/distributions/gradle-4.1-all.zip
.....................................................................................
Starting a Gradle Daemon (subsequent builds will be faster)
Download https://maven.google.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
(--- 257 MORE DOWNLOADS --- )
(--- SOME MORE LINES ---)
BUILD SUCCESSFUL in 47m 52s
46 actionable tasks: 46 executed
Built the following apk(s):
        D:\Code\Ionic\IonicSideMenuApp\platforms\android\app\build\outputs\apk\debug\app-debug.apk  

I wanted to know -

  1. Why the project is identified as "Android Studio project"?
    • I created the project using Ionic CLI.
  2. Why is it downloading gradle-4.1-all.zip?
    • As instructed here, I installed the latest version (5.2.1) of Gradle and added it to the PATH
  3. What are all those .pom and .jar files (downloaded after gradle-4.1-all.zip) used for?
    • I never worked with Gradle build system before
    • Looks like the downloaded files get stored in C:\Users\UserName\.gradle directory
  4. If these are the files used to build the app then how is the main gradle binary used with them?
    • If that is "how gradle works", could you please suggest a simplified resource to learn about it? I tried gradle documentation.
  5. How did it identify Gradle 4.10.1?
    • I found gradle-4.10.1 on my machine in the Android Studio installation directory, but it's not added to the PATH

So, it seems I'm trying to have a clear picture of "under-the-hood of Cordova build process for Android". Any suggestion will be appreciated.

READ ALSO
Where are text files stored by pydroid 3?

Where are text files stored by pydroid 3?

I tried basic filing like creating a file , appending to a file etc and reading from a file, which works, but i also want to see the actual fileWhere is it stored exactly?

35
WifiP2pManager Connect sometimes causes multiple prompts

WifiP2pManager Connect sometimes causes multiple prompts

I am writing an Android application with WiFi DirectI create a group on one device with this line of code

38
Firebase RecyclerView one view to another view [on hold]

Firebase RecyclerView one view to another view [on hold]

How to open one Recyclerview to another and another Recyclerview to open details of the relative list option details

50