Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* With the latest release of AGP, Gradle and Kotlin it's now possible to use Java 24! To update AGP you also need to update Android Studio, otherwise the new AGP version wouldn't work.
- With desugaring Java 24 can be used with min-sdk 26, see: https://developer.android.com/studio/write/java8-support#library-desugaring
- Update the following (at least): */
- // libs.versions.toml
- agp = "8.13.0"
- kotlin = "2.2.20"
- // gradle-wrapper.properties
- distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
- // build.gradle.kts (example below)
- plugins {
- alias(libs.plugins.android.application)
- alias(libs.plugins.kotlin.android)
- alias(libs.plugins.kotlin.compose)
- }
- android {
- namespace = "info.remzi.madlevel2_task1"
- compileSdk = 36
- defaultConfig {
- applicationId = "info.remzi.madlevel2_task1"
- minSdk = 26
- targetSdk = 36
- versionCode = 1
- versionName = "1.0"
- testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
- }
- buildTypes {
- release {
- isMinifyEnabled = true
- proguardFiles(
- getDefaultProguardFile("proguard-android-optimize.txt"),
- "proguard-rules.pro"
- )
- }
- }
- compileOptions {
- sourceCompatibility = JavaVersion.VERSION_24
- targetCompatibility = JavaVersion.VERSION_24
- }
- buildFeatures {
- compose = true
- }
- }
- java {
- toolchain {
- languageVersion.set(JavaLanguageVersion.of(24))
- }
- }
- kotlin {
- compilerOptions {
- jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_24)
- }
- }
- dependencies {
- implementation(libs.androidx.core.ktx)
- implementation(libs.androidx.lifecycle.runtime.ktx)
- implementation(libs.androidx.activity.compose)
- implementation(platform(libs.androidx.compose.bom))
- implementation(libs.androidx.compose.ui)
- implementation(libs.androidx.compose.ui.graphics)
- implementation(libs.androidx.compose.ui.tooling.preview)
- implementation(libs.androidx.compose.material3)
- testImplementation(libs.junit)
- androidTestImplementation(libs.androidx.junit)
- androidTestImplementation(libs.androidx.espresso.core)
- androidTestImplementation(platform(libs.androidx.compose.bom))
- androidTestImplementation(libs.androidx.compose.ui.test.junit4)
- debugImplementation(libs.androidx.compose.ui.tooling)
- debugImplementation(libs.androidx.compose.ui.test.manifest)
- }
Add Comment
Please, Sign In to add comment