Apps 247
Apps 247

Reputation: 603

Android dependency 'android.arch.lifecycle:runtime' has different version for the compile (1.0.0) and runtime (1.1.1) classpath

So my flutter android app runs fine with firebase google services 4.0.1, but when I add the dependancy "firebase_auth" to pubspec.yaml, it produces this error:

Execution failed for task ':app:preDebugBuild'.

Android dependency 'android.arch.lifecycle:runtime' has different version for the compile (1.0.0) and runtime (1.1.1) classpath. You should manually set the same version via DependencyResolution

The package is gotten correctly in the pubspec. Any help would be appreciated.

Upvotes: 4

Views: 1931

Answers (2)

Nuqo
Nuqo

Reputation: 4081

Add this to your android/build.gradle

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'android.arch.lifecycle'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "1.1.1"
            }
        }
    }
}

Upvotes: 0

add to app level build.gradle.

implementation "android.arch.lifecycle:extensions:1.1.1"
testImplementation "android.arch.core:core-testing:1.1.1"

Good Luck dear.

Upvotes: 4

Related Questions