Fix unknown resource type error message
Instead of printing the tag name, print the type name when the type was
unable to be recognized. The type name is initialized to the tag name
and changes when a type attribute is defined..
Bug: 37891551
Test: manual
Change-Id: I9b0e6a6f2d96a8c5af71fbca8e83c947a8e308bf
diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp
index fe401e2..5994073 100644
--- a/tools/aapt2/ResourceParser.cpp
+++ b/tools/aapt2/ResourceParser.cpp
@@ -693,7 +693,7 @@
// If the resource type was not recognized, write the error and return false.
diag_->Error(DiagMessage(out_resource->source)
- << "unknown resource type '" << parser->element_name() << "'");
+ << "unknown resource type '" << resource_type << "'");
return false;
}