Building from source¶
Environment requirements¶
- JDK 21.
- Android SDK Platform 37.0.
- Android SDK Build-Tools 36.0.0.
- Windows, Linux, or macOS.
The project includes a Gradle Wrapper, so you do not need to install Gradle separately.
Building the APK¶
Run the following in the repository root:
In Windows PowerShell, you can use:
Outputs:
Optional builds¶
REQUIRE_SECURE_ENV test package¶
Output:
Unit tests¶
To run only the knowledge pack tests:
Version numbers¶
CI derives the version from vX.Y.Z tags:
versionNameis the tag with the leadingvremoved;versionCode= major × 10000 + minor × 100 + patch.
Local builds use versionCode=1 and versionName=1.0 by default. You can also pass them manually:
Installing on a device¶
If you do not need adb, you can also transfer the APK to the phone and install it manually.
CI¶
.github/workflows/build.yml builds in the following cases:
- A push to
main; - A new or updated pull request;
- A push of a
v*tag; - A manual
workflow_dispatchtrigger.
The workflow:
- Installs JDK 21;
- Installs the Android SDK;
- Runs unit tests;
- Builds debug APKs for
appandtestapp; - Uploads the
nestspace-debugartifact; - If the tag is
v*, creates a GitHub Release with the APK attached.
Common build issues¶
Permission denied: ./gradlew¶
A gradlew committed from Windows may lose its executable bit. Restore it in Git:
Android SDK not found¶
Confirm that sdk.dir in local.properties points to the local Android SDK, or open the project in Android Studio and let it generate the file automatically.
Missing SDK packages¶
Install them with sdkmanager:
Java version mismatch¶
Confirm that JAVA_HOME points to JDK 21: