ลิงก์การเขียน
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Android Lint เป็นเครื่องมือที่มีประสิทธิภาพในการยืนยันความถูกต้องของโค้ด ขอแนะนำเป็นอย่างยิ่งให้คุณแก้ไขข้อผิดพลาดของ Lint ที่ระบุ
ก่อนที่จะเผยแพร่แอปไปยังเวอร์ชันที่ใช้งานจริง
Compose จะมาพร้อมกับการตรวจสอบ Lint จำนวนหนึ่งโดยค่าเริ่มต้น ซึ่งจะช่วยยืนยันความถูกต้องของโค้ด Compose
ข้อกำหนดเวอร์ชันขั้นต่ำสำหรับการตรวจสอบ Lint ของ Compose
Compose 1.9 ต้องใช้ปลั๊กอิน Android Gradle (AGP) / Lint เวอร์ชัน 8.8.2 ขึ้นไป เพื่อให้การรองรับการตรวจสอบ Lint มีความเข้ากันได้ง่ายขึ้นและมีเสถียรภาพมากขึ้น
หากคุณใช้ AGP เวอร์ชันต่ำกว่า 8.8.2 และอัปเกรดไม่ได้ คุณ
ระบุเวอร์ชัน Lint ที่จะใช้ในไฟล์ gradle.properties
ได้ดังนี้
android.experimental.lint.version = 8.8.2
ก่อนหน้านี้ การขึ้นต่อกันที่ซับซ้อนของการตรวจสอบ Lint ของ Compose ทำให้เกิดปัญหาความเข้ากันได้บ่อยครั้ง
และทำให้กำหนดเวอร์ชันเครื่องมือที่ถูกต้องได้ยาก (Android Studio, AGP/Lint, Compose)
ข้อกำหนดเวอร์ชันขั้นต่ำสำหรับ Compose, AGP และ Studio มีดังนี้
เวอร์ชันเขียน |
เวอร์ชัน AGP / Lint ที่จำเป็น |
เวอร์ชัน Studio ที่จำเป็น |
1.9 |
8.8.2 ขึ้นไป |
Ladybug+ |
1.8 |
8.6.0 ขึ้นไป |
การอัปเดตฟีเจอร์ใหม่ของ Koala -> Meerkat |
1.7 |
8.4.0 ขึ้นไป |
แมงกะพรุน -> เมียร์แคต |
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-09-03 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-09-03 UTC"],[],[],null,["[Android Lint](/studio/write/lint) is a powerful tool for verifying the correctness or\nyour code. It is highly recommended that you fix any identified lint errors\nbefore releasing your app to production.\n\nCompose ships with a number of lint checks by default. This helps verify the\ncorrectness of your Compose code.\n\nMinimum version requirement for Compose lint checks\n\nTo simplify compatibility and improve stability for lint check support, Compose\n1.9 requires Android Gradle Plugin (AGP) / Lint version 8.8.2 or higher.\n\nIf you're using an AGP version lower than 8.8.2 and are unable to upgrade, you\ncan specify the lint version to use in your `gradle.properties` file: \n\n android.experimental.lint.version = 8.8.2\n\nPreviously, the complex dependencies of Compose lint checks led to frequent\ncompatibility issues and made it difficult to determine the correct tool\nversions (Android Studio, AGP/Lint, Compose).\n\nMinimum version requirements for Compose, AGP, and Studio are as follows:\n\n|---------------------|---------------------------------|--------------------------------|\n| **Compose Version** | **Required AGP / Lint version** | **Required Studio version** |\n| 1.9 | 8.8.2+ | Ladybug+ |\n| 1.8 | 8.6.0+ | Koala Feature Drop -\\\u003e Meerkat |\n| 1.7 | 8.4.0+ | Jellyfish -\\\u003e Meerkat |"]]