เขียนไปยังแผนที่ความเข้ากันได้ของ Kotlin

การประกาศทรัพยากร Dependency

หากต้องการเพิ่มทรัพยากร Dependency ในคอมไพเลอร์ Compose คุณต้องเพิ่มที่เก็บ Google Maven ไปยัง อ่านที่เก็บ Maven ของ Google เพื่อดูข้อมูลเพิ่มเติม

เพิ่มทรัพยากร Dependency สำหรับอาร์ติแฟกต์ที่คุณต้องการในไฟล์ build.gradle สำหรับ ในแอปหรือโมดูล

Groovy

android {
    buildFeatures {
        compose true
    }

    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.14"
    }

    kotlinOptions {
        jvmTarget = "19"
    }
}

Kotlin

android {
    buildFeatures {
        compose = true
    }

    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.14"
    }

    kotlinOptions {
        jvmTarget = "19"
    }
}

ความเข้ากันได้กับ Kotlin รุ่นทดลอง

สำหรับเวอร์ชันคอมไพเลอร์ของ Compose ที่ใช้ได้กับเวอร์ชันก่อนเผยแพร่ของ Kotlin โปรดดูที่ https://androidx.dev/storage/compose-compiler/repository เพื่อดูรายละเอียดเพิ่มเติม

เขียนเวอร์ชันคอมไพเลอร์ เวอร์ชัน Kotlin ที่เข้ากันได้
ใช้ปลั๊กอิน Compose Compiler Gradle เพื่อเปิดใช้ Compose 2.0.0 ขึ้นไป
1.5.14 1.9.24
1.5.13 1.9.23
1.5.12 1.9.23
1.5.11 1.9.23
1.5.10 1.9.22
1.5.9 1.9.22
1.5.8 1.9.22
1.5.7 1.9.21
1.5.6 1.9.21
1.5.5 1.9.20
1.5.4 1.9.20
1.5.3 1.9.10
1.5.2 1.9.0
1.5.1 1.9.0
1.5.0 1.9.0
1.4.8 1.8.22
1.4.7 1.8.21
1.4.6 1.8.20
1.4.5 1.8.20
1.4.4 1.8.10
1.4.3 1.8.10
1.4.2 1.8.10
1.4.1 1.8.0
1.4.0 1.8.0
1.4.0-alpha02 1.7.21
1.4.0-alpha01 1.7.20
1.3.2 1.7.20
1.3.1 1.7.10
1.3.0 1.7.10
1.3.0-Rc02 1.7.10
1.3.0-Rc01 1.7.10
1.3.0-เบต้า01 1.7.10
1.2.0 1.7.0
1.2.0-Rc02 1.6.21
1.2.0-Rc01 1.6.21
1.2.0-เบต้า03 1.6.21
1.2.0-เบต้า02 1.6.21
1.2.0-เบต้า01 1.6.21
1.2.0-alpha08 1.6.20
1.2.0-alpha07 1.6.10
1.2.0-alpha06 1.6.10
1.2.0-alpha05 1.6.10
1.2.0-alpha04 1.6.10
1.2.0-alpha03 1.6.10
1.2.0-alpha02 1.6.10
1.2.0-alpha01 1.6.10
1.1.1 1.6.10
1.1.0 1.6.10
1.1.0-Rc03 1.6.10
1.1.0-Rc02 1.6.10
1.1.0-Rc01 1.6.0
1.1.0-เบต้า 1.6.0
1.1.0-เบต้า03 1.5.31
1.1.0-เบต้า02 1.5.31
1.1.0-เบต้า01 1.5.31
1.1.0-alpha06 1.5.31
1.1.0-alpha05 1.5.31
1.0.5 1.5.31
1.0.4 1.5.31
1.1.0-alpha04 1.5.30
1.1.0-alpha03 1.5.30
1.0.3 1.5.30
1.1.0-alpha02 1.5.21
1.1.0-alpha01 1.5.21
1.0.2 1.5.21
1.0.1 1.5.21
1.0.0 1.5.10
1.0.0-Rc02 1.5.10
1.0.0-Rc01 1.5.10