Caused by: com.android.tools.r8.internal.f: Type com.example.myapplication.BuildConfig is defined multiple times: /Users/marcphrassias/Documents/myapplication/build/app/intermediates/javac/debug/classes/com/example/myapplication/BuildConfig 3.class, /Users/marcphrassias/Documents/myapplication/build/app/intermediates/javac/debug/classes/com/example/myapplication/BuildConfig 5.class at com.android.tools.r8.internal.LT.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:14) at com.android.tools.r8.internal.LT.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:22) at com.android.tools.r8.internal.JN.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:36) at com.android.tools.r8.internal.JN.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:10) at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048) at com.android.tools.r8.internal.JN.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:6) at com.android.tools.r8.graph.B2$a.e(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:7) at com.android.tools.r8.dex.b.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:101) at com.android.tools.r8.dex.b.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:25) at com.android.tools.r8.dex.b.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:24) at com.android.tools.r8.D8.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:25) at com.android.tools.r8.D8.d(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:606) at com.android.tools.r8.D8.b(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:1) at com.android.tools.r8.internal.Hj.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:24) ... 43 more
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:dexBuilderDebug'.
There were multiple failures while executing work items A failure occurred while executing com.android.build.gradle.internal.dexing.DexWorkAction > Failed to process: /Users/marcphrassias/Documents/myapplication/build/app/tmp/kotlin-classes/debug, /Users/marcphrassias/Documents/myapplication/build/app/intermediates/javac/debug/classes A failure occurred while executing com.android.build.gradle.internal.dexing.DexWorkAction > Failed to process: /Users/marcphrassias/Documents/myapplication/build/app/tmp/kotlin-classes/debug, /Users/marcphrassias/Documents/myapplication/build/app/intermediates/javac/debug/classes
- 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 4s
┌─ 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 │
└────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1
Exited
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 31 // modifié
ndkVersion flutter.ndkVersion
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.myapplication"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 21 //modifié
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
// multiDexEnabled true //ajouter
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" //ajouter
}
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
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// implementation 'com.android.support:multidex:2.0.1'
}
apply plugin: 'com.google.gms.google-services'