Search code examples
androidandroid-instant-appsandroid-architecture

A dependent feature was defined but no package ID was set. You are probably missing a feature dependency in the base feature


I am following one of the Google Codelabs for making an Instant App.

And I was trying to create topeka-ui (A UI feature module for Instant Apps).

When I try to run one of the instant app module it says :

A dependent feature was defined but no package ID was set. You are probably missing a feature dependency in the base feature.


Solution

  • I just ran through the codelab on AS 3.0 beta 2 without issues (*note). After what point in the codelab did your issue appear?

    You might’ve missed a step. Double check that your base module’s build.gradle has:

    dependencies {
        ...
        application project(":topekaapk")
        feature project(":topekaui")
    }
    

    Leaving out feature project(":topekaui") can cause this error:

    Error:com.android.builder.internal.aapt.AaptException: A dependent feature was defined but no package ID was set. You are probably missing a feature dependency in the base feature.

    Note: because data-binding has been disabled for non-base modules (https://issuetracker.google.com/63814741), there requires some additional steps in the multi-feature step-7 to get around it (ie. getting rid of the DataBindingUtil).