75 lines
2.6 KiB
Kotlin
75 lines
2.6 KiB
Kotlin
// build.gradle.kts (Module: :app)
|
|
|
|
plugins {
|
|
// 1. Core Android and Kotlin plugins (MUST be first)
|
|
id("com.android.application")
|
|
kotlin("android")
|
|
|
|
id("org.jetbrains.kotlin.plugin.compose") // Note: No version is specified here
|
|
}
|
|
|
|
android {
|
|
// 2. Android Configuration
|
|
namespace = "com.placeholder.sherpai2"
|
|
compileSdk = 34
|
|
|
|
defaultConfig {
|
|
applicationId = "com.placeholder.sherpai2"
|
|
minSdk = 24
|
|
targetSdk = 34
|
|
versionCode = 1
|
|
versionName = "1.0"
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
// 3. Kotlin & Java Settings
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
}
|
|
kotlinOptions {
|
|
jvmTarget = "1.8"
|
|
}
|
|
|
|
// 4. Jetpack Compose Configuration (Crucial!)
|
|
buildFeatures {
|
|
compose = true
|
|
}
|
|
|
|
composeOptions {
|
|
kotlinCompilerExtensionVersion = "1.5.8" // Must match your Kotlin version
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// --- CORE ANDROID & LIFECYCLE ---
|
|
implementation("androidx.core:core-ktx:1.12.0")
|
|
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.7.0")
|
|
implementation("androidx.activity:activity-compose:1.8.2") // Fixes 'activity' ref error
|
|
|
|
// --- JETPACK COMPOSE UI (Material 3) ---
|
|
implementation("androidx.compose.ui:ui")
|
|
implementation("androidx.compose.ui:ui-graphics")
|
|
implementation("androidx.compose.ui:ui-tooling-preview")
|
|
implementation("androidx.compose.material3:material3") // Fixes 'material3' ref error
|
|
|
|
// --- COMPOSE ICONS (Fixes 'material' and 'Icons' ref errors) ---
|
|
// Uses direct string to avoid Version Catalog conflicts
|
|
implementation("androidx.compose.material:material-icons-extended:1.6.0")
|
|
|
|
// --- STATE MANAGEMENT / COROUTINES ---
|
|
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
|
|
|
|
// --- TESTING ---
|
|
testImplementation("junit:junit:4.13.2")
|
|
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
|
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
|
|
debugImplementation("androidx.compose.ui:ui-tooling")
|
|
debugImplementation("androidx.compose.ui:ui-test-manifest")
|
|
|
|
implementation("androidx.compose.foundation:foundation:1.6.0") // Use your current Compose version
|
|
implementation("androidx.compose.material3:material3:1.2.1") // <-- Fix/Reconfirm Material 3
|
|
} |