android - Flutter Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath' - Stack Over

admin2025-04-20  0

While updating my old project from Flutter 2.x.x to 3.29 I am getting this error. I am using java 17 version. Flutter version is 3.29. I have updated all packages im my pubspec.yaml file but still having error while running it in Android devices.

environment: sdk: ">=3.3.0 <4.0.0"

The key issue is that multiple libraries require different versions of the same dependencies, and Gradle doesn't know which one to use.

android/app/build.gradle file:

dependencies {
    // Kotlin - use the newest version
    implementation ".jetbrains.kotlin:kotlin-stdlib:1.9.22"

    // Yandex Maps
    implementation 'com.yandex.android:maps.mobile:4.2.2-full'

    // Google Play Services - use consistent versions
    implementation 'com.google.android.gms:play-services-auth:20.4.0'
    implementation 'com.google.android.gms:play-services-auth-api-phone:18.0.1'
    implementation 'com.google.android.gms:play-services-mlkit-face-detection:17.1.0'
    implementation 'com.google.android.gms:play-services-mlkit-text-recognition:18.0.2'
    implementation 'com.google.android.gms:play-services-mlkit-barcode-scanning:18.2.0'
    implementation 'com.google.android.gms:play-services-location:21.0.1'

    // Firebase - use the latest BOM to manage Firebase dependency versions
    implementation platform('com.google.firebase:firebase-bom:33.9.0')
    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'com.google.firebase:firebase-messaging:24.1.0'

    // Coroutines
    api ".jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
    api ".jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"

    // AndroidX libraries - use consistent versions
    implementation 'androidx.core:core-ktx:1.12.0'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
    implementation 'androidx.window:window:1.1.0'
    implementation 'androidx.window:window-java:1.1.0'
    implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
    implementation 'androidx.annotation:annotation:1.7.1'
    implementation 'androidx.exifinterface:exifinterface:1.3.7'

    // Other dependencies
    implementation 'io.ktor:ktor-client-android:2.3.5'
    implementation 'com.google.guava:guava:33.1.0-android'
    implementation 'com.google.android.material:material:1.11.0'
    implementation 'com.google.code.gson:gson:2.10.1'
    implementation 'com.getbouncer:tensorflow-lite:2.1.0004'
    implementation "com.getbouncer:scan-payment-full:2.2.0003"

    // Desugaring for Java 8+ features
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

android/build.gradle file:

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

    dependencies {
        classpath 'com.android.tools.build:gradle:8.2.2'
        // START: FlutterFire Configuration
        classpath 'com.google.gms:google-services:4.3.10'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.5'
        // END: FlutterFire Configuration
        classpath ".jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}
allprojects {
    repositories {
        google()
        mavenCentral()
    }

    configurations.all {
        resolutionStrategy {
            // 
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745106564a285325.html

最新回复(0)