Gradle error debugCompileClasspath' to contain exactly one file, however, it contains no files, when adding a new Dynamic Feature Module

Viewed 2539

Created a new Dynamic Feature Module: dynamic, build fails with the below exception: Execution failed for task ':dynamic:processDebugManifest'.

Expected configuration ':dynamic:debugCompileClasspath' to contain exactly one file, however, it contains no files.

Tried adding baseFeature true to the app gradle, and getting error:

Could not find method baseFeature() for arguments [true] on object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.

2 Answers

I solved this, you need to have all flavors of the base module in your dynamic feature module also

I had the same error message but the problem was with the common KTS script I was using across the feature modules:

This was wrong:

private fun Project.configureDependencies() {
    dependencies.project(":app")
}

This was right:

private fun Project.configureDependencies() = dependencies{
    add("implementation", project(":app"))
}

Hope this helps some poor soul

Related