Теперь, от официальной документации из Google, я понимаю, что мое приложение должно автоматически поддерживать размеры 16 КБ из-за современного SDK, AGP и NDK, которые я упоминал выше. Но ... При создании моего приложения я все еще вижу следующее.
Код: Выделить всё
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:8.11.0'
}
repositories {
google()
mavenCentral()
}
}
allprojects {
repositories {
google()
mavenCentral()
}
subprojects {
afterEvaluate { project ->
if (project.plugins.hasPlugin('kotlin-android') || project.plugins.hasPlugin('kotlin')) {
project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions.jvmTarget = "17"
}
}
if (project.hasProperty('android')) {
project.android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
}
}
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id "com.google.gms.google-services"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
android {
flavorDimensions "x"
compileOptions {
coreLibraryDesugaringEnabled true
}
buildFeatures {
buildConfig = true
}
compileSdkVersion 35
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "x"
minSdkVersion 24
targetSdkVersion 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
debug {
minifyEnabled false
}
}
lintOptions {
checkReleaseBuilds false
disable 'InvalidPackage'
}
namespace 'x'
ndkVersion "29.0.13599879 rc2"
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.10"
implementation 'com.google.firebase:firebase-messaging:25.0.0'
implementation 'androidx.appcompat:appcompat:1.7.1'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
}
< /code>
Не возражайте против «X», используемого для пространства имен, Flavordimensions, ApplicationId, это не то, что я на самом деле использую. Если требуется дополнительная информация, дайте мне знать.
Подробнее здесь: https://stackoverflow.com/questions/797 ... er-android