Setting up the project with Bazel #5643
Unanswered
adhiamboperes
asked this question in
Q&A (Installation)
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Operating System
MacOs
Android Studio Version
Giraffe
RAM size
16GB
Free disk space
24GB
Which step are you stuck on?
This is a general log of the issues I encountered while setting up the project with the Bazel Plugin and how I fixed them.
Error Log
Approaches already used to resolve the issue
For
ERROR 1:
, I installed API 34 by selecting Android Studio > Settings > Language & Frameworks > Android SDK > Android API 34 > Apply > OkERROR 2:
was caused when I tried to use the deploy icon (green arrow) in Android Studio to deploy on an emulator running on API 34. For Bazel, this button triggers incremental builds(as opposed to building the apk from scratch). This is prohibited in API 34. I solved this by switching to an emulator using API 29.Additional information
Here is how I actually set up the project to work with Bazel on Android Studio.
Used a newer version of AS. I have Giraffe installed, but please feel free to update up to LadyBug(Yaay!).
On the welcome screen, I selected plugins and installed the Bazel for Android Studio plugin, and restarted AS.
On next open, I clicked the options button next to the new project/open project to find the "Import Bazel Project" option.
For Workspace, I clicked (...) to open file manager and selected
/opensource/oppia-android
as the location since this is where we have our project'sWORKSPACE
file.On next, to Select Project View, I selected the option to Generate from BUILD file, and selected (...) to open file manager again. In the same project root,
/opensource/oppia-android
, I scrolled down and selected the BUILD.bazel file.On pressing next, the below file was generated:
In the above file, under "targets: # If source code isn't resolving, add additional targets that compile it here" I added the following:
//:oppia
Beta Was this translation helpful? Give feedback.
All reactions