diff --git a/dexpreopt/class_loader_context.go b/dexpreopt/class_loader_context.go index 375921729..deaf77fe4 100644 --- a/dexpreopt/class_loader_context.go +++ b/dexpreopt/class_loader_context.go @@ -437,7 +437,11 @@ func validateClassLoaderContextRec(sdkVer int, clcs []*ClassLoaderContext) (bool if sdkVer == AnySdkVersion { // Return error if dexpreopt doesn't know paths to one of the // dependencies. In the future we may need to relax this and just disable dexpreopt. - return false, fmt.Errorf("invalid path for \"%s\"", clc.Name) + if clc.Host == nil { + return false, fmt.Errorf("invalid build path for \"%s\"", clc.Name) + } else { + return false, fmt.Errorf("invalid install path for \"%s\"", clc.Name) + } } else { // No error for compatibility libraries, as Soong doesn't know if they are needed // (this depends on the targetSdkVersion in the manifest), but the CLC is invalid. diff --git a/dexpreopt/class_loader_context_test.go b/dexpreopt/class_loader_context_test.go index df6856390..be7d4c63b 100644 --- a/dexpreopt/class_loader_context_test.go +++ b/dexpreopt/class_loader_context_test.go @@ -195,7 +195,7 @@ func TestCLCMaybeAdd(t *testing.T) { // But class loader context in such cases should raise an error on validation. t.Run("validate", func(t *testing.T) { _, err := validateClassLoaderContext(m) - checkError(t, err, "invalid path for \"a\"") + checkError(t, err, "invalid build path for \"a\"") }) }