From a34348af14744ab100513579316a34bfe33d4c3b Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Wed, 25 Mar 2026 16:54:48 +0100 Subject: [PATCH 01/11] Clarify JAVA_HOME setup in Fenix building instructions Updated instructions for setting JAVA_HOME with a specific command. --- docs/building.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index 6a0cd14475..9e7ca420dd 100644 --- a/docs/building.md +++ b/docs/building.md @@ -102,7 +102,7 @@ The following instructions assume that you are building `application-services` f 1. Install Android SDK, JAVA, NDK and set required env vars 1. Clone the [firefox-android](https://github.com/mozilla-mobile/firefox-android) repository (**not** inside the Application Service repository). 1. Install [Java **17**](https://www.oracle.com/java/technologies/downloads/#java17) for your system - 1. Set `JAVA_HOME` to point to the JDK 17 installation directory. + 1. Set `JAVA_HOME` to point to the JDK 17 installation directory, using `export JAVA_HOME=$(/usr/libexec/java_home -v 17)` 1. Download and install [Android Studio](https://developer.android.com/studio/#downloads). 1. Set `ANDROID_SDK_ROOT` and `ANDROID_HOME` to the Android Studio sdk location and add it to your rc file (either `.zshrc` or `.bashrc` depending on the shell you use for your terminal). 1. Configure the required versions of NDK From d5ecdf100b6865e0a0237a3c38fed6b6b1699af5 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Wed, 25 Mar 2026 18:16:16 +0100 Subject: [PATCH 02/11] Fix NDK instructions --- docs/building.md | 6 +++--- libs/android_defaults.sh | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/building.md b/docs/building.md index 9e7ca420dd..3f7c0660bd 100644 --- a/docs/building.md +++ b/docs/building.md @@ -105,9 +105,9 @@ The following instructions assume that you are building `application-services` f 1. Set `JAVA_HOME` to point to the JDK 17 installation directory, using `export JAVA_HOME=$(/usr/libexec/java_home -v 17)` 1. Download and install [Android Studio](https://developer.android.com/studio/#downloads). 1. Set `ANDROID_SDK_ROOT` and `ANDROID_HOME` to the Android Studio sdk location and add it to your rc file (either `.zshrc` or `.bashrc` depending on the shell you use for your terminal). - 1. Configure the required versions of NDK - `Configure menu > System Settings > Android SDK > SDK Tools > NDK > Show Package Details > NDK (Side by side)` - - 29.0.14206865 (required by Application Services, [as configured](https://github.com/mozilla/application-services/blob/main/build.gradle#L33)) + 1. Configure the required versions of NDK in Android Studio + `Settings > Languages & Frameworks > Android SDK > SDK Tools`. Pick `Android SDK Command-line Tools`. Check `Show Package Details`, and pick `NDK (Side by side)` in the right version: + - 29.0.14206865 (required by Application Services, [as configured](https://github.com/mozilla/application-services/blob/bb8cde8a5/taskcluster/docker/linux/Dockerfile#L25)) 1. If you are on Windows using WSL - drop to the section below, [Windows setup for Android (WSL)](building.md#windows-setup-for-android-via-wsl) before proceeding. 1. Check dependencies, environment variables diff --git a/libs/android_defaults.sh b/libs/android_defaults.sh index 14bd1d8de4..f9eb8d4923 100755 --- a/libs/android_defaults.sh +++ b/libs/android_defaults.sh @@ -4,6 +4,7 @@ if [[ -z "${ANDROID_NDK_HOME:-}" || -z "${ANDROID_NDK_ROOT:-}" ]]; then pushd .. + echo "Initializing NDK. Can take a few seconds." NDK_VERSION=$(./gradlew -q printNdkVersion | tail -1) export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/$NDK_VERSION" export ANDROID_NDK_ROOT="$ANDROID_NDK_HOME" From eab7ebca2fe2dcc7d2bddd1addad5509083c903b Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Wed, 25 Mar 2026 18:20:01 +0100 Subject: [PATCH 03/11] Mention mozilla-central instead of mozilla-mobile/firefox-android --- docs/building.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index 3f7c0660bd..4cb27543b3 100644 --- a/docs/building.md +++ b/docs/building.md @@ -100,7 +100,7 @@ The following instructions assume that you are building `application-services` f [Fenix Auto-publication workflow for android-components and application-services](howtos/locally-published-components-in-fenix.md). 1. Install Android SDK, JAVA, NDK and set required env vars - 1. Clone the [firefox-android](https://github.com/mozilla-mobile/firefox-android) repository (**not** inside the Application Service repository). + 1. [Bootstrap a Firefox for Android environment](https://firefox-source-docs.mozilla.org/mobile/android/index.html) (**not** inside the Application Service repository). 1. Install [Java **17**](https://www.oracle.com/java/technologies/downloads/#java17) for your system 1. Set `JAVA_HOME` to point to the JDK 17 installation directory, using `export JAVA_HOME=$(/usr/libexec/java_home -v 17)` 1. Download and install [Android Studio](https://developer.android.com/studio/#downloads). From 13ebfdaae5953ce4eb9a32a32ddcf8489285eb35 Mon Sep 17 00:00:00 2001 From: Alex Cottner Date: Tue, 31 Mar 2026 07:09:45 -1000 Subject: [PATCH 04/11] Updating building instructions based on pairing sessions over the last few days with android team --- docs/building.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/building.md b/docs/building.md index 4cb27543b3..0a8de16894 100644 --- a/docs/building.md +++ b/docs/building.md @@ -101,19 +101,25 @@ The following instructions assume that you are building `application-services` f 1. Install Android SDK, JAVA, NDK and set required env vars 1. [Bootstrap a Firefox for Android environment](https://firefox-source-docs.mozilla.org/mobile/android/index.html) (**not** inside the Application Service repository). - 1. Install [Java **17**](https://www.oracle.com/java/technologies/downloads/#java17) for your system - 1. Set `JAVA_HOME` to point to the JDK 17 installation directory, using `export JAVA_HOME=$(/usr/libexec/java_home -v 17)` 1. Download and install [Android Studio](https://developer.android.com/studio/#downloads). - 1. Set `ANDROID_SDK_ROOT` and `ANDROID_HOME` to the Android Studio sdk location and add it to your rc file (either `.zshrc` or `.bashrc` depending on the shell you use for your terminal). - 1. Configure the required versions of NDK in Android Studio - `Settings > Languages & Frameworks > Android SDK > SDK Tools`. Pick `Android SDK Command-line Tools`. Check `Show Package Details`, and pick `NDK (Side by side)` in the right version: - - 29.0.14206865 (required by Application Services, [as configured](https://github.com/mozilla/application-services/blob/bb8cde8a5/taskcluster/docker/linux/Dockerfile#L25)) + 1. Configure android studio to use the bootstrapped SDK under `Settings > Languages & Frameworks > Android SDK`, set it to the boostraped sdk from mozbuild. Ex: `~/.mozbuild/android-sdk-linux` + 1. Download the required NDK and command-line tools under `Settings > Languages & Frameworks > Android SDK > SDK Tools`. Pick: + 1. NDK (Side by side) version 29.0.14206865 [as configured](https://github.com/mozilla/application-services/blob/bb8cde8a5/taskcluster/docker/linux/Dockerfile#L25) + 1. Android SDK Command-line Tools (latest) + 1. Set environment variables based on the boostrapped code and the downloaded ndk. Add it to your rc file (either `.zshrc` or `.bashrc` depending on your shell) to make it permanent + 1. Set `JAVA_HOME` to point to the bootstraped JDK 17 installation directory. Ex: `export JAVA_HOME=~/.mozbuild/jdk/jdk-17.0.18+8/` + 1. Set `ANDROID_SDK_ROOT` to the bootstraped android sdk. Ex: `export ANDROID_SDK_ROOT=~/.mozbuild/android-sdk-linux` + 1. Set `ANDROID_HOME` to the bootstraped android sdk. Ex: `export ANDROID_HOME=~/.mozbuild/android-sdk-linux` + 1. Set `NSS_STATIC` to 1. Ex: `export NSS_STATIC=1` + 1. Set `NSS_DIR` to your local nss folder. Ex: `export NSS_DIR=~/Mozilla/application-services/libs/desktop/linux-x86-64/nss` + 1. Set `ANDROID_NDK_ROOT` to the ndk you downloaded via android studio, Ex: `export ANDROID_NDK_ROOT=~/.mozbuild/android-sdk-linux/ndk/29.0.14206865` 1. If you are on Windows using WSL - drop to the section below, [Windows setup for Android (WSL)](building.md#windows-setup-for-android-via-wsl) before proceeding. 1. Check dependencies, environment variables 1. Run `./libs/verify-android-environment.sh` 2. Follow instructions and rerun until it is successful. +**Note:** If you opened the application-services or firefox repos in android studio, it likely added a `local.properties` file that could override some of the environment variables above. If you experience build errors, correct or delete these values in the `local.properties` files. ### Windows setup for Android (via WSL) From 74f75553c446328831caae81a253d7c7bbd95aab Mon Sep 17 00:00:00 2001 From: Alex Cottner Date: Tue, 31 Mar 2026 07:13:38 -1000 Subject: [PATCH 05/11] Simplifying instructions --- docs/building.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index 0a8de16894..54a3ef1865 100644 --- a/docs/building.md +++ b/docs/building.md @@ -108,7 +108,6 @@ The following instructions assume that you are building `application-services` f 1. Android SDK Command-line Tools (latest) 1. Set environment variables based on the boostrapped code and the downloaded ndk. Add it to your rc file (either `.zshrc` or `.bashrc` depending on your shell) to make it permanent 1. Set `JAVA_HOME` to point to the bootstraped JDK 17 installation directory. Ex: `export JAVA_HOME=~/.mozbuild/jdk/jdk-17.0.18+8/` - 1. Set `ANDROID_SDK_ROOT` to the bootstraped android sdk. Ex: `export ANDROID_SDK_ROOT=~/.mozbuild/android-sdk-linux` 1. Set `ANDROID_HOME` to the bootstraped android sdk. Ex: `export ANDROID_HOME=~/.mozbuild/android-sdk-linux` 1. Set `NSS_STATIC` to 1. Ex: `export NSS_STATIC=1` 1. Set `NSS_DIR` to your local nss folder. Ex: `export NSS_DIR=~/Mozilla/application-services/libs/desktop/linux-x86-64/nss` From 1fa1f7f2574ea64cf9ab5328a73a430b89a6d681 Mon Sep 17 00:00:00 2001 From: Alex Cottner <148472676+alexcottner@users.noreply.github.com> Date: Fri, 3 Apr 2026 09:32:13 -1000 Subject: [PATCH 06/11] Fixing casing and adding mac example Co-authored-by: Mathieu Leplatre --- docs/building.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index 54a3ef1865..64547614df 100644 --- a/docs/building.md +++ b/docs/building.md @@ -102,7 +102,7 @@ The following instructions assume that you are building `application-services` f 1. Install Android SDK, JAVA, NDK and set required env vars 1. [Bootstrap a Firefox for Android environment](https://firefox-source-docs.mozilla.org/mobile/android/index.html) (**not** inside the Application Service repository). 1. Download and install [Android Studio](https://developer.android.com/studio/#downloads). - 1. Configure android studio to use the bootstrapped SDK under `Settings > Languages & Frameworks > Android SDK`, set it to the boostraped sdk from mozbuild. Ex: `~/.mozbuild/android-sdk-linux` + 1. Configure Android Studio to use the bootstrapped SDK under `Settings > Languages & Frameworks > Android SDK`, set it to the SDK from mozbuild. Ex: `~/.mozbuild/android-sdk-linux` or `~/.mozbuild/android-sdk-macos` 1. Download the required NDK and command-line tools under `Settings > Languages & Frameworks > Android SDK > SDK Tools`. Pick: 1. NDK (Side by side) version 29.0.14206865 [as configured](https://github.com/mozilla/application-services/blob/bb8cde8a5/taskcluster/docker/linux/Dockerfile#L25) 1. Android SDK Command-line Tools (latest) From bd1e3737f563a3768bb6ccf90785162ba2a9b128 Mon Sep 17 00:00:00 2001 From: Alex Cottner <148472676+alexcottner@users.noreply.github.com> Date: Fri, 3 Apr 2026 09:32:33 -1000 Subject: [PATCH 07/11] Fixing casing Co-authored-by: Mathieu Leplatre --- docs/building.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index 64547614df..08732e8fc4 100644 --- a/docs/building.md +++ b/docs/building.md @@ -106,7 +106,7 @@ The following instructions assume that you are building `application-services` f 1. Download the required NDK and command-line tools under `Settings > Languages & Frameworks > Android SDK > SDK Tools`. Pick: 1. NDK (Side by side) version 29.0.14206865 [as configured](https://github.com/mozilla/application-services/blob/bb8cde8a5/taskcluster/docker/linux/Dockerfile#L25) 1. Android SDK Command-line Tools (latest) - 1. Set environment variables based on the boostrapped code and the downloaded ndk. Add it to your rc file (either `.zshrc` or `.bashrc` depending on your shell) to make it permanent + 1. Set environment variables based on the boostrapped code and the downloaded NDK. Add it to your rc file (either `.zshrc` or `.bashrc` depending on your shell) to make it permanent 1. Set `JAVA_HOME` to point to the bootstraped JDK 17 installation directory. Ex: `export JAVA_HOME=~/.mozbuild/jdk/jdk-17.0.18+8/` 1. Set `ANDROID_HOME` to the bootstraped android sdk. Ex: `export ANDROID_HOME=~/.mozbuild/android-sdk-linux` 1. Set `NSS_STATIC` to 1. Ex: `export NSS_STATIC=1` From 66d86d68ccd70387c76bea1ce916a686936657fb Mon Sep 17 00:00:00 2001 From: Alex Cottner <148472676+alexcottner@users.noreply.github.com> Date: Fri, 3 Apr 2026 09:32:49 -1000 Subject: [PATCH 08/11] Fixing casing Co-authored-by: Mathieu Leplatre --- docs/building.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index 08732e8fc4..1189805bc3 100644 --- a/docs/building.md +++ b/docs/building.md @@ -108,7 +108,7 @@ The following instructions assume that you are building `application-services` f 1. Android SDK Command-line Tools (latest) 1. Set environment variables based on the boostrapped code and the downloaded NDK. Add it to your rc file (either `.zshrc` or `.bashrc` depending on your shell) to make it permanent 1. Set `JAVA_HOME` to point to the bootstraped JDK 17 installation directory. Ex: `export JAVA_HOME=~/.mozbuild/jdk/jdk-17.0.18+8/` - 1. Set `ANDROID_HOME` to the bootstraped android sdk. Ex: `export ANDROID_HOME=~/.mozbuild/android-sdk-linux` + 1. Set `ANDROID_HOME` to the bootstraped Android SDK. Ex: `export ANDROID_HOME=~/.mozbuild/android-sdk-linux` 1. Set `NSS_STATIC` to 1. Ex: `export NSS_STATIC=1` 1. Set `NSS_DIR` to your local nss folder. Ex: `export NSS_DIR=~/Mozilla/application-services/libs/desktop/linux-x86-64/nss` 1. Set `ANDROID_NDK_ROOT` to the ndk you downloaded via android studio, Ex: `export ANDROID_NDK_ROOT=~/.mozbuild/android-sdk-linux/ndk/29.0.14206865` From a5fad7a1e259ebc89bb99f3dc8e86567056193a3 Mon Sep 17 00:00:00 2001 From: Alex Cottner <148472676+alexcottner@users.noreply.github.com> Date: Fri, 3 Apr 2026 09:33:03 -1000 Subject: [PATCH 09/11] Fixing casing Co-authored-by: Mathieu Leplatre --- docs/building.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index 1189805bc3..e03a72763c 100644 --- a/docs/building.md +++ b/docs/building.md @@ -110,7 +110,7 @@ The following instructions assume that you are building `application-services` f 1. Set `JAVA_HOME` to point to the bootstraped JDK 17 installation directory. Ex: `export JAVA_HOME=~/.mozbuild/jdk/jdk-17.0.18+8/` 1. Set `ANDROID_HOME` to the bootstraped Android SDK. Ex: `export ANDROID_HOME=~/.mozbuild/android-sdk-linux` 1. Set `NSS_STATIC` to 1. Ex: `export NSS_STATIC=1` - 1. Set `NSS_DIR` to your local nss folder. Ex: `export NSS_DIR=~/Mozilla/application-services/libs/desktop/linux-x86-64/nss` + 1. Set `NSS_DIR` to your local NSS folder. Ex: `export NSS_DIR=~/Mozilla/application-services/libs/desktop/linux-x86-64/nss` 1. Set `ANDROID_NDK_ROOT` to the ndk you downloaded via android studio, Ex: `export ANDROID_NDK_ROOT=~/.mozbuild/android-sdk-linux/ndk/29.0.14206865` 1. If you are on Windows using WSL - drop to the section below, [Windows setup for Android (WSL)](building.md#windows-setup-for-android-via-wsl) before proceeding. From aca5fbca663a15c5fc5bb2153eb50913b6e4665e Mon Sep 17 00:00:00 2001 From: Alex Cottner <148472676+alexcottner@users.noreply.github.com> Date: Fri, 3 Apr 2026 09:33:15 -1000 Subject: [PATCH 10/11] Fixing casing Co-authored-by: Mathieu Leplatre --- docs/building.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index e03a72763c..b767aaab4f 100644 --- a/docs/building.md +++ b/docs/building.md @@ -111,7 +111,7 @@ The following instructions assume that you are building `application-services` f 1. Set `ANDROID_HOME` to the bootstraped Android SDK. Ex: `export ANDROID_HOME=~/.mozbuild/android-sdk-linux` 1. Set `NSS_STATIC` to 1. Ex: `export NSS_STATIC=1` 1. Set `NSS_DIR` to your local NSS folder. Ex: `export NSS_DIR=~/Mozilla/application-services/libs/desktop/linux-x86-64/nss` - 1. Set `ANDROID_NDK_ROOT` to the ndk you downloaded via android studio, Ex: `export ANDROID_NDK_ROOT=~/.mozbuild/android-sdk-linux/ndk/29.0.14206865` + 1. Set `ANDROID_NDK_ROOT` to the NDK you downloaded via Android Studio, Ex: `export ANDROID_NDK_ROOT=~/.mozbuild/android-sdk-linux/ndk/29.0.14206865` 1. If you are on Windows using WSL - drop to the section below, [Windows setup for Android (WSL)](building.md#windows-setup-for-android-via-wsl) before proceeding. 1. Check dependencies, environment variables From db5b673df1136e1535440a0967495341c2180644 Mon Sep 17 00:00:00 2001 From: Alex Cottner <148472676+alexcottner@users.noreply.github.com> Date: Fri, 3 Apr 2026 09:33:45 -1000 Subject: [PATCH 11/11] Fixing casing and adding gradle example Co-authored-by: Mathieu Leplatre --- docs/building.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index b767aaab4f..ea24e44b03 100644 --- a/docs/building.md +++ b/docs/building.md @@ -118,7 +118,7 @@ for Android (WSL)](building.md#windows-setup-for-android-via-wsl) before proceed 1. Run `./libs/verify-android-environment.sh` 2. Follow instructions and rerun until it is successful. -**Note:** If you opened the application-services or firefox repos in android studio, it likely added a `local.properties` file that could override some of the environment variables above. If you experience build errors, correct or delete these values in the `local.properties` files. +**Note:** If you opened the application-services or Firefox repos in Android Studio, it likely added a `local.properties` or `gradle-daemon-jvm.properties` file that could override some of the environment variables above. If you experience build errors, correct or delete these values in the `local.properties` files. ### Windows setup for Android (via WSL)