Search code examples
android-gradle-pluginbazelandroid-source

How to use bazel to build the AGP source code


I Downloaded AGP source code from here and follow these instructions, but now when I try to build the source code or run tests i face following error

this is my branch "studio-master-dev"

bazel test //tools/base/...
 fetching local_repository rule //external:blaze: java.io.IOException: The repository's path is "tools/vendor/google3/blaze" (absolute: "/Users/username/studio-master-dev/tools/vendor/google3/blaze") but it does not exist or is not a directory.

I checked the path and error is right the folder doesn't exist but How can I fix it?


Solution

  • The warning at the top of the instructions the OP links to says that it does not work outside of Google:

    Warning: This does not currently work for AOSP Issue 126764883. The required binaries are checked in as prebuilts, so you can run tests using Intellij (tools/base and tools/idea projects), Ant (Studio only) and Gradle (Build system and command line tools).