deveshpatel-TW

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.

Most Liked

premsinghsodha7

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.

  1. Open Run > Edit Configurations, click +, and choose Gradle.
  2. Select the root Gradle project.
  3. Set the task to :Library1:assembleDebug and name the configuration Build Library1 Debug.
  4. 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.

Where Next?

Popular Android topics Top

AndroidMan
I’ve tried signing up for Airnow as I used to do very well when they were Airpush, but i haven’t used them in years. I went through the s...
New
CristianM92
Hi, I’m working on an app who make the conversion between decimal degrees and degrees minutes seconds. I have to make an “Export” button ...
New
cajasigwe
Hi, Please I need help to get DHIS2 Capture working in Android Tablet Phone desk ( KT5-3C) Android Version: 10. Build: KT5-3C_LTE05M0_K...
New
Aathithyan
I need to know how to implement outgoing call in my custom application instead of using default phone call app i need my own app call.
New
mfaamir
Dear Sir, I am a beginner in Android App development and I am currently trying to establish a connection between my Android Studio Java ...
New
cve60069
Hello I am starting the tearning curve to writing an app for my galaxy phone. Me and my friens play a lot of “Texas Hold-Em” and, for t...
New
Briannamari
Old android photo name sequence Help decoding file names Example. I want to see if a file name aligns with a time / date in which the p...
New
Garrett
I’m stuck trying to understand how to get a variable initialised, and later updated, in kotlin to update in Jetpack Compose and cause a c...
New
Devraj5032
I’m using TensorFlow Lite (TFLite) with React Native Expo. When I test the app using the Expo Go app, everything works fine. However, whe...
New
yosefk
I’m creating Hotspot network in Android by WifiManager.startLocalOnlyHotspot. It register the I/F in NetworkInterfaces but it does not i...
New

Other popular topics Top

PragmaticBookshelf
Brace yourself for a fun challenge: build a photorealistic 3D renderer from scratch! In just a couple of weeks, build a ray tracer that r...
New
Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
New
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
PragmaticBookshelf
25 puzzles that will make you a better C programmer by challenging your knowledge of the language, and explaining the technical details o...
New
PragmaticBookshelf
An illustrated guide to understanding and effectively using regular expressions. Staffan Nöteberg To effectively use regular expressi...
New
PragmaticBookshelf
Write elegant Ruby code—not just correct, but idiomatic. Go beyond the vocabulary and syntax and learn to express yourself with eloquence...
New