-
Notifications
You must be signed in to change notification settings - Fork 527
Bazel Setup Instructions for Linux
The steps to install Bazel on Linux are:
- Install Bazel
- Set up the ANDROID_HOME environment variable
- Verify the Android build
Install Bazel from here. Make sure that you follow the instructions for installing a specific version (Oppia Android requires 6.5.0 and won't build on other versions).
- Note: if you find any errors related to
cURL
, please set up cURL on your machine. For Linux, you can usesudo apt install curl
.
Ensure that your ANDROID_HOME
environment variable is set to the location of your Android SDK. To do this, find the path to the installed SDK using Android Studio’s SDK Manager (install SDK 28). Assuming the SDK is installed to default locations, you can use the following commands to set the ANDROID_HOME
variable:
export ANDROID_HOME=$HOME/Android/Sdk/
Make sure you have the system environment variable set up for ANDROID_HOME
as you might have issues getting properly set up if not. If it isn’t set up (on Linux you can check by using echo $ANDROID_HOME
in a new terminal; it should output the correct path to your Android SDK), on Linux you can move the export
from above to your ~/.bashrc
file to make it permanent (you can apply the change immediately using source ~/.bashrc
).
At this point, your system should be able to build Oppia Android. To verify, try building the APK (from your subsystem terminal -- note that this and all other Bazel commands must be run from the root of the ‘oppia-android’ directory otherwise they will fail):
bazel build //:oppia_dev
(Note that this command may take 10-20 minutes to complete depending on the performance of your machine).
If everything is working, you should see output like the following:
Target //:oppia_dev up-to-date:
bazel-bin/oppia_dev.aab
INFO: Elapsed time: ...
INFO: 1 process...
INFO: Build completed successfully, ...
Note also that the oppia_dev.aab
under the bazel-bin
directory of your local copy of Oppia Android should be a fully functioning development version of the app that can be installed using bundle-tool. However, it's recommended to deploy Oppia to an emulator or connected device using the following Bazel command:
bazel run //:install_oppia_dev
Have an idea for how to improve the wiki? Please help make our documentation better by following our instructions for contributing to the wiki.
Core documentation
Developing Oppia
- Contributing to Oppia Android
- Bazel
- Key Workflows
- Testing
- Developing Skills
- Frequent Errors and Solutions
- RTL Guidelines
- Working on UI
- Writing Design Docs
Developer Reference
- Code style
- Background Processing
- Dark mode
- Buf Guide
- Firebase Console Guide
- Platform Parameters & Feature Flags
- Work Manager
- Dependency Injection with Dagger
- Revert & regression policy
- Upgrading target SDK version
- Spotlight Guide
- Triaging Process
- Bazel
- Internationalization
- Terminology in Oppia
- Past Events