Skip to content

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

32 Commits

Folders and files

Repository files navigation

Put artifact at www folder

mkdir www
cp -rp artifact www/

Install Cordova

npm install -g cordova
cordova platform add android

Install Android Development Tools

Java Development Kit (JDK)

brew install --cask temurin@17

Gradle

npm run build:release downloads and uses Gradle 8.14.2 automatically.

Android SDK

brew install --cask android-studio
  1. Install Android Studio

  2. Adding SDK Packages

    Open the Android SDK Manager (Tools > SDK Manager in Android Studio, or sdkmanager on the command line), and make sure the following are installed:

    • Android Platform SDK 36

    • Android SDK Build-Tools 36.0.0

    • Android SDK Command-line Tools (latest)

    • Android SDK Platform-Tools

Setting environment variables

  1. Set the JAVA_HOME environment variable to the location of your JDK installation
  2. Set the ANDROID_HOME environment variable to the location of your Android SDK installation
  3. It is also recommended that you add the Android SDK's command-line tools, emulator and platform-tools directories to your PATH
export JAVA_HOME=<java-location>
export ANDROID_HOME=<sdk-location>
export PATH=$PATH:$ANDROID_HOME/platform-tools/
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin/
export PATH=$PATH:$ANDROID_HOME/emulator/
export ANDROID_HOME=/c/Users/icer/AppData/Local/Android/Sdk

Check

In the cordova project directory, run

cordova requirements

If you have successfully installed all the required tools above, the result should be like:

Requirements check results for android:
Java JDK: installed 17.0.20
Android SDK: installed true
Android target: installed android-36
Gradle: installed <gradle-8.14.2-location>/bin/gradle

Build

cordova build android

Test in Emulator

  1. Create a Device

    Android Studio - Virtual Device Manager - Create Device

  2. Run App

cordova run android --emulator

Release

  1. Modify version in config.xml; the build writes it to the Android package automatically.
  2. Replace files in www\ with latest package download from Azure Devops Pipelines.
  3. Copy .env.example to .env, set the signing credentials, and build release with npm run build:release.
  4. Upload aab package to Google Play Console
  • Production -> Create Release -> Upload
  1. Download Signed, universal APK from app bundle.
  2. Remember to upload latest APK to github release.

Upgrade API version

config.xml

    <preference name="android-targetSdkVersion" value="36" />
cordova platform remove android
cordova platform add android@15.0.0
sdkmanager.bat "platforms;android-36"
sdkmanager.bat "build-tools;36.0.0"
cordova requirements
npm run build:release

FAQ

Q: How do I fix the “Unsupported class file major version 66” error when compiling Android with Cordova?

A: This is caused by using a Java version that's too high; downgrading to Java 17 will resolve the issue.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages