diff --git a/java/config/config.go b/java/config/config.go index c19a705c9..654d9352f 100644 --- a/java/config/config.go +++ b/java/config/config.go @@ -80,14 +80,18 @@ func init() { pctx.HostBinToolVariable("SoongZipCmd", "soong_zip") pctx.HostBinToolVariable("MergeZipsCmd", "merge_zips") pctx.VariableFunc("DxCmd", func(config interface{}) (string, error) { - dexer := "d8" if config.(android.Config).IsEnvFalse("USE_D8") { - dexer = "dx" - } - if config.(android.Config).UnbundledBuild() || config.(android.Config).IsPdkBuild() { - return "prebuilts/build-tools/common/bin/" + dexer, nil + if config.(android.Config).UnbundledBuild() || config.(android.Config).IsPdkBuild() { + return "prebuilts/build-tools/common/bin/dx", nil + } else { + path, err := pctx.HostBinToolPath(config, "dx") + if err != nil { + return "", err + } + return path.String(), nil + } } else { - path, err := pctx.HostBinToolPath(config, dexer) + path, err := pctx.HostBinToolPath(config, "d8-compat-dx") if err != nil { return "", err } diff --git a/root.bp b/root.bp index 6788fa7c4..bc591714d 100644 --- a/root.bp +++ b/root.bp @@ -29,6 +29,7 @@ optional_subdirs = [ "packages/apps/*", "prebuilts/clang/host/linux-x86", "prebuilts/ndk", + "prebuilts/r8", "prebuilts/sdk", "prebuilts/misc", "system/*",