diff --git a/android/module.go b/android/module.go index 64fbdacc2..c1f3e7936 100644 --- a/android/module.go +++ b/android/module.go @@ -1441,7 +1441,11 @@ func (ctx *androidModuleContext) ExpandSourcesSubDir(srcFiles, excludes []string if m := SrcIsModule(e); m != "" { module := ctx.GetDirectDepWithTag(m, SourceDepTag) if module == nil { - ctx.ModuleErrorf(`missing dependency on %q, is the property annotated with android:"path"?`, m) + if ctx.Config().AllowMissingDependencies() { + ctx.AddMissingDependencies([]string{m}) + } else { + ctx.ModuleErrorf(`missing dependency on %q, is the property annotated with android:"path"?`, m) + } continue } if srcProducer, ok := module.(SourceFileProducer); ok { @@ -1458,7 +1462,11 @@ func (ctx *androidModuleContext) ExpandSourcesSubDir(srcFiles, excludes []string if m := SrcIsModule(s); m != "" { module := ctx.GetDirectDepWithTag(m, SourceDepTag) if module == nil { - ctx.ModuleErrorf(`missing dependency on %q, is the property annotated with android:"path"?`, m) + if ctx.Config().AllowMissingDependencies() { + ctx.AddMissingDependencies([]string{m}) + } else { + ctx.ModuleErrorf(`missing dependency on %q, is the property annotated with android:"path"?`, m) + } continue } if srcProducer, ok := module.(SourceFileProducer); ok {