deveshpatel-TW
Building Individual Libraries Through the Android Studio UI
I’m currently experimenting with Android Studio for a project that consists of multiple independent Android Library modules that internally use Kotlin, CMake and C++ code.
MyProject
-------------------------
app
Library1
Library2
Library3
-------------------------
Each library/module:
- has its own build.gradle
- has its own CMakeLists.txt
- may have dependencies on other libraries/modules
What I would like to achieve is a simple UI-driven workflow inside Android Studio where a developer can select a particular library and build only that library.
Something conceptually like:
Libraries
--------------------
Library 1
Library 2
Library 3
--------------------
[BUILD]
--------------------
or through some existing Android Studio tool window/menu option that allows building individual libraries/modules.
Currently, I can invoke Gradle Tasks such as ‘:Library1:build’ from the terminal, which works fine.
First Post!
premsinghsodha7
You can give each library a saved Gradle run configuration, so developers can select it from the toolbar and click Run. No custom plugin is needed.
- Open Run > Edit Configurations, click +, and choose Gradle.
- Select the root Gradle project.
- Set the task to
:Library1:assembleDebugand name the configurationBuild Library1 Debug. - Apply it, select that configuration in the toolbar, and click Run. Repeat for the other libraries or variants.
Use :Library1:build instead if you want its broader build/check lifecycle, matching your terminal command. For producing a particular AAR, assembleDebug or assembleRelease keeps the intention clearer; flavor names change the task name.
You can also run tasks from View > Tool Windows > Gradle. Saved configurations are useful when the task tree is incomplete or you want a short list of named build actions.
“Only Library1” means its task and required dependencies. Gradle can still build another library that Library1 depends on. Its configured native build participates through the Android Gradle plugin; you do not need a separate UI action for each CMakeLists.txt.
References: Gradle run configurations, Android library/AAR builds.
Popular Android topics
Other popular topics
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /python
- /js
- /rails
- /security
- /go
- /swift
- /vim
- /java
- /clojure
- /typescript
- /emacs
- /haskell
- /svelte
- /onivim
- /kotlin
- /react
- /c-plus-plus
- /crystal
- /tailwind
- /gleam
- /ocaml
- /elm
- /vscode
- /flutter
- /html
- /ash
- /deepseek
- /zig
- /opensuse
- /php
- /centos
- /react-native
- /scala
- /lisp
- /textmate
- /sublime-text
- /nixos
- /debian
- /agda
- /deno
- /django
- /kubuntu
- /nodejs
- /arch-linux
- /ubuntu
- /spring
- /revery
- /manjaro
- /julia
- /diversity
- /quarkus
- /lua
- /laravel









