android/build.gradle:
Код: Выделить всё
buildscript {
ext.kotlin_version = '2.1.0'
repositories {
google()
mavenCentral()
maven {
url = uri("https://storage.googleapis.com/r8-releases/raw")
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
Код: Выделить всё
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
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 {
namespace "com.example.tutoriumtutorsapp"
compileSdkVersion flutter.compileSdkVersion
ndkVersion "25.1.8937393"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.tutoriumtutorsapp"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 23
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
debug {
minifyEnabled false
shrinkResources false
}
}
}
flutter {
source '../..'
}
dependencies {
implementation 'com.android.support:multidex:2.0.1'
}
Код: Выделить всё
Launching lib\main.dart on itel A665L in debug mode...
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply
Warning: SDK processing. This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4
ERROR:D8: com.android.tools.r8.kotlin.H
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform firebase-auth-23.1.0.aar (com.google.firebase:firebase-auth:23.1.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for DexingWithClasspathTransform: C:\Users\buaba\.gradle\caches\transforms-3\3fec588c55714a9966fb3503a9bf4019\transformed\jetified-firebase-auth-23.1.0-runtime.jar.
> Error while dexing.
> Failed to transform recaptcha-18.5.1.aar (com.google.android.recaptcha:recaptcha:18.5.1) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for DexingWithClasspathTransform: C:\Users\buaba\.gradle\caches\transforms-3\4705e1a9dfa350f22c16438d10434c91\transformed\jetified-recaptcha-18.5.1-runtime.jar.
> Error while dexing.
> Failed to transform annotation-jvm-1.9.1.jar (androidx.annotation:annotation-jvm:1.9.1) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.category=library, org.gradle.jvm.environment=standard-jvm, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}.
> Execution failed for DexingWithClasspathTransform: C:\Users\buaba\.gradle\caches\transforms-3\ec831d85a03f9ec13a447dad91a371d5\transformed\jetified-annotation-jvm-1.9.1.jar.
> Error while dexing.
> Failed to transform kotlin-stdlib-2.1.0.jar (org.jetbrains.kotlin:kotlin-stdlib:2.1.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.category=library, org.gradle.jvm.environment=standard-jvm, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}.
> Execution failed for DexingWithClasspathTransform: C:\Users\buaba\.gradle\caches\transforms-3\e4a1ecd774eafcb1c6c7c7ca5943e414\transformed\jetified-kotlin-stdlib-2.1.0.jar.
> Error while dexing.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3m 54s
┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐
│ [!] The shrinker may have failed to optimize the Java bytecode. │
│ To disable the shrinker, pass the `--no-shrink` flag to this command. │
│ To learn more, see: https://developer.android.com/studio/build/shrink-code │
└────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1
Exited (1).
Как я упоминал ранее, это старый проект Flutter, и я использую эту версию Flutter:
Flutter 3.24.5 • стабильный канал • https://github.com/flutter/flutter.git
Framework • версия dec2ee5c1f (4 недели назад) • 2024-11-13 11:13:06 -0800
Двигатель • версия a18df97ca5
Инструменты • Dart 3.5.4 • DevTools 2.37.3
Подробнее здесь: https://stackoverflow.com/questions/792 ... xtdexdebug