From b56c539549f3c852f0fadb43057ed2685d99be03 Mon Sep 17 00:00:00 2001 From: sky121113 Date: Wed, 10 Jun 2026 17:09:23 +0800 Subject: [PATCH] =?UTF-8?q?[CHORE]=20=E6=96=B0=E5=A2=9E=20.editorconfig=20?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=20XML=20=E6=AA=94=E9=A0=AD=20UTF-8=20BOM?= =?UTF-8?q?=EF=BC=88aapt2=20=E6=89=93=E5=8C=85=E9=98=B2=E5=91=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 供 UIUX 設計師直接在本 repo 改 UI 時,編輯器不再寫入 BOM 導致 aapt2 失敗。 Co-Authored-By: Claude Opus 4.8 (1M context) --- .editorconfig | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..03c609d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,22 @@ +root = true + +# 全專案預設:UTF-8(不含 BOM)、LF、檔尾換行 +# 重點:charset = utf-8(非 utf-8-bom)可避免編輯器在 XML 開頭塞入 BOM, +# 否則 aapt2 會報「Cannot read field "elmName" because "root" is null」導致打包失敗。 +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{xml,java,kt,kts,gradle,pro}] +charset = utf-8 +indent_style = space +indent_size = 4 + +# 二進位資源不套用規則 +[*.{png,webp,jpg,jpeg,gif,ttf,otf,9.png}] +charset = unset +end_of_line = unset +insert_final_newline = unset +trim_trailing_whitespace = unset