Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 903
erluxman Avatar asked Aug 26 '17 03:08

erluxman


3 Answers

I had an issue in that I had an Android app and an Android Library, but I had used the wrong plugin by mistake.

For an app:

plugins {
    id "com.android.application"
    id "kotlin-android"
}

For a library:

plugins {
    id "com.android.library"
    id "kotlin-android"
}
like image 67
Damien Dennehy Avatar answered Nov 05 '22 01:11

Damien Dennehy


Since this is the only stackoverflow question for "A dependent feature was defined but no package ID was set. You are probably missing a feature dependency in the base feature." I will answer what my issue was here rather than create a new question. I had a module that was giving me this error and couldn't figure out the problem. In the dependent module's build.gradle file, I had:

apply plugin: 'com.android.feature'

It should have been:

apply plugin: 'com.android.library'
like image 38
tim.paetz Avatar answered Nov 05 '22 00:11

tim.paetz


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).

like image 11
TWL Avatar answered Nov 05 '22 02:11

TWL