I have two different android apps A and B. A and B are modules in the same project
Both have a dependency on a library module Z which itself depends on two other library modules X and Y
- A -> Z
- B -> Z
Z -> X, Y
Now the accepted answer to this question says that a single Android Studio project cannot have multiple apps.
Strangely I am able to build these two apps (in a single android studio project) and run them on my phone pretty well. Am I missing something obvious here ?
Can a single android studio project contain multiple apps ?
- If the answer is NO, why ?
- If the answer is YES, are there any catches ?
A single Android project can indeed have multiple apps, although you could argue about the benefits of having several apps in a single project if they are unrelated.
Anyway, this is perfectly reasonable in case you have several versions of the same app with some differences among them (target devices, branding...). In that case the Gradle build system allows you to have build variants (each build variant being a combination of a product flavor and a build type). According to the official documentation (Configuring Gradle Builds > Work with build variants):