4

In my base(:app) module build.gradle file I have (under defaultConfig block)

applicationId "com.example.mobile"

In my dynamic feature module build.gradle I have (under defaultConfig block)

applicationId "com.example.mobile.ondemand"

Similarly in the manifest of base module I have

package="com.example.mobile"

And in manifest of dynamic feature module I have

package="com.example.mobile.ondemand"

I've tried a lot so solutions, I've upgraded gradle and jdk to latest versions, I've tried removing applicationId and package values from the dynamic feature module. Also I've adhere to all the guidelines mentioned by google for implementing on demand feature module . Still I am getting this issue every time I build

Execution failed for task ':ondemand:generateDebugBuildConfig'.
> Failed to calculate the value of task ':ondemand:generateDebugBuildConfig' property 'applicationId'.
   > Failed to calculate the value of property 'applicationId'.
      > Collection is empty.

Some help would be really appreciated.

Ashwani Kumar
  • 1,402
  • 1
  • 19
  • 26

1 Answers1

0

Make sure the flavors and build types in your dynamic feature module perfectly matches the flavors and build types in your app module. This includes matching the logic for any setIgnore(true) combinations.

For example, if your app has both "internal" and "production" flavors, be sure to include this in your dynamic feature module:

android {
//...
    buildTypes {
        debug
        release
    }

    productFlavors {
        internal
        production
    }
}

If you disallow any build variant combo in your main app module, copy the logic you use for that to your dynamic feature module, such as:

    variantFilter { variant ->
        def names = variant.flavors*.name
        if (names.contains('production') && variant.buildType.name == 'debug') {
            setIgnore(true)
        }
    }
colintheshots
  • 1,992
  • 19
  • 37