Files
mozc/docs/build_mozc_for_android.md
Yohei Yukawa 44542afa83 Follow PEP 394 in build_mozc_for_android.md (#1194)
This follows up to my previous commit [1], which introduced

  docs/build_mozc_for_android.md

as a dedicated build instruction page for building 'libmozc.so' for
Android as part of removing the dependency on Docker from our build
instructions (#1181).

While the above document uses 'python3' elsewhere, there was one place
where 'python' was used instead. It would be better to avoid 'python'
in favor of PEP 394 [2].

 [1]: f215eaf71a
 [2]: https://peps.python.org/pep-0394/

PiperOrigin-RevId: 730872687
2025-02-26 15:34:48 +09:00

2.3 KiB

How to build libmozc.so for Android

Android lib

Summary

If you are not sure what the following commands do, please check the descriptions below and make sure the operations before running them.

git clone https://github.com/google/mozc.git
cd mozc/src

export PYTHON_VENV_ROOT=${PWD}/python-venv
python3 -m venv ${PYTHON_VENV_ROOT}
source ${PYTHON_VENV_ROOT}/bin/activate
python3 -m pip install requests

python3 build_tools/update_deps.py

bazelisk build package --config oss_android --config release_build

Client code for Android apk is deprecated. (the last revision with Android client code is afb03dd).

Setup

System Requirements

Currently macOS and Linux are tested to build libmozc.so for Android.

Software Requirements

Building libmozc.so for Android requires the following software.

  • bazelisk
  • C++ compiler (GCC or clang)
  • Python 3.9 or later with the following pip module.
    • requests

Build instructions

Get the Code

You can download Mozc source code as follows:

git clone https://github.com/google/mozc.git
cd mozc/src

Hereafter you can do all the operations without changing directory.

Set up and enable Python virtual environment

The following commands set up Python virtual environment under mozc/src/python-venv.

export PYTHON_VENV_ROOT=${PWD}/python-venv
python3 -m venv ${PYTHON_VENV_ROOT}
source ${PYTHON_VENV_ROOT}/bin/activate
python3 -m pip install requests

Using mozc/src/python-venv as the virtual environment location is not mandatory. Any other location should also work.

Check out additional build dependencies

python3 build_tools/update_deps.py

In this step, additional build dependencies will be downloaded.

Build libmozc.so for Android

bazelisk build package --config oss_android --config release_build

package is an alias to build android/jni:native_libs.