Skip to content Skip to sidebar Skip to footer

Build Fails With 'task :features:catalog:createdebugcompatiblescreenmanifests Failed' While Refactoring To Dynamic Feature Modules On Android

Once I introduced dynamic feature modules into my app, I was able to successfully refactor feature one (orders), build and deploy. But on refactoring the second module, i.e moving

Solution 1:

The issue ended up being a library I had imported.

The library had plugin apply plugin: 'com.android.application' instead of apply plugin: 'com.android.library'

As such, gradle build task was looking for applicationId and applicationName in the manifest, which was not there.

Oops, developer error.

Solution 2:

Uninstall the application from emulator and then restart it

Solution 3:

For me it happened when adding a new dynamic feature module with multiple flavors.

I solved it by changing inside module.gradle:

implementationproject(path: ':app', configuration: 'default')

into

implementation project(":app")

Then add flavors into module.gradle

flavorDimensions "app"

productFlavors {
    flavor1 {}
    flavor2 {}
    flavor3 {}
}

Here is my final module.gradle

apply plugin: 'com.android.dynamic-feature'

android {
    compileSdkVersion 29
    buildToolsVersion '29.0.3'

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    flavorDimensions "app"

    productFlavors {
        flavor1 {}
        flavor2 {}
        flavor3 {}
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation project(":app")
}

Post a Comment for "Build Fails With 'task :features:catalog:createdebugcompatiblescreenmanifests Failed' While Refactoring To Dynamic Feature Modules On Android"