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.
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"
}
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'
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With