Better error for hidl_package_root being missing.
Provide instructions directly in the error message for
how to fix this error since it is new and non-obvious,
this is the best place to document the structure.
Bug: several people have had problems with this
Test: build both with and without triggering the error
Change-Id: I3f4071689c434b26b28d429df6a72c6c4f056961
diff --git a/build/hidl_interface.go b/build/hidl_interface.go
index a38a899..b467d1a 100644
--- a/build/hidl_interface.go
+++ b/build/hidl_interface.go
@@ -132,7 +132,17 @@
root := interfaceObject.properties.Root
rootObject := lookupPackageRoot(root)
if rootObject == nil {
- mctx.PropertyErrorf("interfaces", "Cannot find package root for "+i+" which is '"+root+"'")
+ mctx.PropertyErrorf("interfaces", `Cannot find package root specification for package `+
+ `root '%s' needed for module '%s'. Either this is a mispelling of the package `+
+ `root, or a new hidl_package_root module needs to be added. For example, you can `+
+ `fix this error by adding the following to <some path>/Android.bp:
+
+hidl_package_root {
+ name: "%s",
+ path: "<some path>",
+}
+
+This corresponds to the "-r%s:<some path>" option that would be passed into hidl-gen.`, root, i, root, root)
hasError = true
continue
}