skip to Main Content

Execution failed for task ‘:app:mergeExtDexDebug’.

Could not resolve all files for configuration ‘:app:debugRuntimeClasspath’.
raryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
raryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for DexingNoClasspathTransform: C:UsersGanesh Waje.gradlecachestransforms-3eca9a3155755829de657c56dd5ec41a3transformedjetified-appcompat-resources-1.7.0-runtime.jar.
> Error while dexing.
Failed to transform appcompat-1.7.0.aar (androidx.appcompat:appcompat:1.7.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=25, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for DexingNoClasspathTransform: C:UsersGanesh Waje.gradlecachestransforms-3560616332cdd3e7f4155e4c3061ec9e8transformedappcompat-1.7.0-runtime.jar.
> Error while dexing.

this is my build.gradle android level

buildscript {
    ext.kotlin_version = '2.0.0'
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:8.0.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "com.google.gms:google-services:4.4.2" // Corrected versioning
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
    configurations.all {
        resolutionStrategy {
            force("androidx.core:core-ktx:1.9.0")
        }
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
    delete rootProject.buildDir
}

this is my build.gradle app level

plugins {
    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 {
    namespace "com.example.main_app"
    compileSdkVersion flutter.compileSdkVersion
    ndkVersion flutter.ndkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.main_app"
        // 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 25
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    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 {
    // Import the Firebase BoM (Bill of Materials) for managing Firebase dependencies
    implementation platform('com.google.firebase:firebase-bom:33.1.1')

    // Add specific Firebase dependencies you want to use
    implementation 'com.google.firebase:firebase-analytics' // Example of Firebase Analytics

    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.7.0'    
}




can any tell that how can i solve error

2

Answers


  1. try to enable multidex in build.gradle in app level

    android {
        defaultConfig {
            ...
            minSdkVersion 25 
            multiDexEnabled true
        }
        ...
    }
    
    Login or Signup to reply.
  2. in build.gradle android level
    change

    ext.kotlin_version = ‘2.0.0’

    to

    ext.kotlin_version = ‘1.9.24’

    it’s work for me.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search