Dark White
Dark White

Reputation: 172

How to create a parent project containing two independent projects in Android Studio

I have two separate Android projects: a camera project and an image editing project. I want to create a new parent project that includes both of these projects and allows them to start independently. Specifically, I want to be able to run the parent project, the camera project, and the editing project separately.

I understand that to run them independently, each project must use the 'com.android.application' plugin instead of 'com.android.library'.

What I Have Tried:

-Created a new parent project.
-Added the camera and editing projects as modules to the parent project.
-Modifying settings.gradle.kts:

    include(":app")
    include(":camera")
    include(":editing")

Adding Dependencies in Parent Project (app) build.gradle.kts:

dependencies {
    implementation(project(":camera"))
    implementation(project(":editing"))
}

However, when I try to run parent project, I encounter the following error:

> Task :app:processDebugResources FAILED
AGPBI: {"kind":"error","text":"Unable to make AAPT link command","sources":[{}],"original":"ERROR: AAPT: ","tool":"AAPT"}

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > Unable to make AAPT link command
     ERROR: AAPT:
...
Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Unable to make AAPT link command
...
Caused by: com.android.builder.internal.aapt.AaptException: Dependent features configured but no package ID was set.

Question:

How can I properly set up a parent project that includes two independent Android projects, allowing each to run separately?

Thank you.

Upvotes: 0

Views: 14

Answers (0)

Related Questions