diff --git a/apex/apex.go b/apex/apex.go index 3b8415e31..7bdf25df3 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -2101,8 +2101,8 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) { // // Always include if we are a host-apex however since those won't have any // system libraries. - if !android.DirectlyInAnyApex(ctx, cc.Name()) && !android.InList(cc.Name(), a.requiredDeps) { - a.requiredDeps = append(a.requiredDeps, cc.Name()) + if !android.DirectlyInAnyApex(ctx, cc.Name()) && !android.InList(cc.BaseModuleName(), a.requiredDeps) { + a.requiredDeps = append(a.requiredDeps, cc.BaseModuleName()) } requireNativeLibs = append(requireNativeLibs, cc.OutputFile().Path().Base()) // Don't track further