Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12bfe654 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "AAPT2: Error on uncompiled XML or PNG files in link phase"

parents c9eb24ce 6a396c1a
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1299,6 +1299,17 @@ class LinkCommand {
        }
      }
      return true;
    } else if (util::stringEndsWith(src.path, ".xml") ||
               util::stringEndsWith(src.path, ".png")) {
      // Since AAPT compiles these file types and appends .flat to them, seeing
      // their raw extensions is a sign that they weren't compiled.
      const StringPiece fileType =
          util::stringEndsWith(src.path, ".xml") ? "XML" : "PNG";
      mContext->getDiagnostics()->error(DiagMessage(src)
                                        << "uncompiled " << fileType
                                        << " file passed as argument. Must be "
                                           "compiled first into .flat file.");
      return false;
    }

    // Ignore non .flat files. This could be classes.dex or something else that