second commit
This commit is contained in:
+65
-33
@@ -1,40 +1,27 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
alias(libs.plugins.hilt)
|
||||
alias(libs.plugins.kapt)
|
||||
}
|
||||
|
||||
android {
|
||||
packaging {
|
||||
jniLibs {
|
||||
useLegacyPackaging = false
|
||||
}
|
||||
}
|
||||
// Для компиляции с поддержкой 16 KB
|
||||
defaultConfig {
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
// ИСПРАВЛЕНИЕ: здесь нужно использовать аргументы и скобки/равенство
|
||||
cppFlags("-Wl,-z,max-page-size=16384")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace = "com.example.myserver"
|
||||
compileSdk {
|
||||
version = release(36)
|
||||
}
|
||||
compileSdk = 35
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.myserver"
|
||||
minSdk = 29
|
||||
targetSdk = 36
|
||||
targetSdk = 35
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
cppFlags += ""
|
||||
arguments("-DANDROID_STL=c++_shared")
|
||||
cppFlags("-Wl,-z,max-page-size=16384")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,10 +35,31 @@ android {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
// Compose и Hilt лучше работают на Java 17
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
}
|
||||
|
||||
composeOptions {
|
||||
kotlinCompilerExtensionVersion = "1.5.1" // Соответствует Kotlin 1.9.0
|
||||
}
|
||||
|
||||
packaging {
|
||||
resources {
|
||||
excludes += "/META-INF/{AL2.0,LGPL2.1,androidx.compose.material3_material3.version}"
|
||||
}
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path = file("src/main/cpp/CMakeLists.txt")
|
||||
@@ -61,18 +69,42 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("com.squareup.retrofit2:retrofit:2.9.0")
|
||||
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
|
||||
// 1. Сначала объявляем BOM (один раз в самом начале)
|
||||
val composeBom = platform("androidx.compose:compose-bom:2024.02.01")
|
||||
implementation(composeBom)
|
||||
androidTestImplementation(composeBom)
|
||||
|
||||
// 2. Jetpack Compose (версии берутся из BOM)
|
||||
implementation(libs.compose.ui)
|
||||
implementation(libs.compose.ui.graphics)
|
||||
implementation(libs.compose.ui.tooling.preview)
|
||||
implementation(libs.activity.compose)
|
||||
implementation(libs.lifecycle.viewmodel.compose)
|
||||
implementation(libs.foundation)
|
||||
|
||||
// 3. Material 3 (обязательно для PullToRefreshBox)
|
||||
implementation("androidx.compose.material3:material3")
|
||||
implementation("androidx.compose.material3:material3-window-size-class")
|
||||
implementation("androidx.compose.material:material-icons-extended")
|
||||
|
||||
// 4. Сеть (Retrofit)
|
||||
implementation(libs.retrofit)
|
||||
implementation(libs.retrofit.gson)
|
||||
implementation(libs.okhttp.logging)
|
||||
|
||||
// 5. Dagger Hilt
|
||||
implementation(libs.hilt.android)
|
||||
kapt(libs.hilt.compiler)
|
||||
implementation("androidx.hilt:hilt-navigation-compose:1.1.0")
|
||||
|
||||
// 6. Остальное
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.material)
|
||||
implementation(libs.activity)
|
||||
implementation(libs.constraintlayout)
|
||||
implementation(libs.recyclerview)
|
||||
implementation(libs.cardview)
|
||||
implementation(libs.viewpager2)
|
||||
implementation(libs.legacy.support.v4)
|
||||
implementation(libs.mediarouter)
|
||||
implementation("androidx.constraintlayout:constraintlayout-compose:1.0.1")
|
||||
|
||||
// Тесты и отладка
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.ext.junit)
|
||||
androidTestImplementation(libs.espresso.core)
|
||||
}
|
||||
debugImplementation(libs.compose.ui.tooling)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user