Strange gradle error Expected configuration (...) to contain exactly one file, however, it contains no files Strange gradle error Expected configuration (...) to contain exactly one file, however, it contains no files android android

Strange gradle error Expected configuration (...) to contain exactly one file, however, it contains no files


Make sure you have "baseFeature true" in the base feature defaultConfig.

If you have no base and only one feature, put baseFeature true in your one feature.

In older versions the feature without a name was the base, but now you need to explitly mark one.


If you see the issue comes from a dynamic feature module, make sure this one depends on the "base" module or whatever module you applied:

apply plugin: 'com.android.application'

since it's going to be the one in charge of building the Android app.

When dynamic features came into play, the way the project is built changed. Until then the application module included all the library modules, but now dynamic feature modules need to include the application module as @ezio mentions:

https://stackoverflow.com/a/53916249/689723


In addition to what is mentioned in the accepted answer, I had to do one more thing to make it work. You have to make sure that all your feature modules should depend on the base module.

Put this in the gradle file of all the feature module

implementation project(':base')