diff --git a/java/aapt2.go b/java/aapt2.go index 70c750716..5553bfdf8 100644 --- a/java/aapt2.go +++ b/java/aapt2.go @@ -111,7 +111,8 @@ func aapt2CompileDirs(ctx android.ModuleContext, flata android.WritablePath, dir var aapt2LinkRule = pctx.AndroidStaticRule("aapt2Link", blueprint.RuleParams{ - Command: `${config.Aapt2Cmd} link -o $out $flags --java $genDir --proguard $proguardOptions ` + + Command: `rm -rf $genDir && ` + + `${config.Aapt2Cmd} link -o $out $flags --java $genDir --proguard $proguardOptions ` + `--output-text-symbols ${rTxt} $inFlags && ` + `${config.SoongZipCmd} -write_if_changed -jar -o $genJar -C $genDir -D $genDir &&` + `${config.ExtractJarPackagesCmd} -i $genJar -o $extraPackages --prefix '--extra-packages '`,