in Education by
I migrated to Android Studio 3 and Gradle 4. Then I changed compile to implementation in my build.gradle files. But I get the error: Error:Execution failed for task ':app:preDebugBuild'. > Android dependency 'com.google.firebase:firebase-core' has different version for the compile (9.0.0) and runtime (11.6.0) classpath. You should manually set the same version via DependencyResolution When I change implementation to api the error disappear. But this is not the solution. I have the app module and one library module. App build.gradle has only one dependency: implementation project(':common-lib') The apply plugin: 'com.google.gms.google-services' is correctly placed at the bottom of the app build.gradle file (the project worked before migration to Gradle 4) Dependencies from gradlew app:dependencies (clipping of text): Compile debugAndroidTestCompileClasspath - Resolved configuration for compilation for variant: debugAndroidTest +--- com.google.firebase:firebase-core:9.0.0 | \--- com.google.firebase:firebase-analytics:9.0.0 | +--- com.google.android.gms:play-services-basement:9.0.0 | | \--- com.android.support:support-v4:23.0.0 | | \--- com.android.support:support-annotations:23.0.0 | +--- com.google.firebase:firebase-common:9.0.0 | | +--- com.google.android.gms:play-services-basement:9.0.0 (*) | | \--- com.google.android.gms:play-services-tasks:9.0.0 | | \--- com.google.android.gms:play-services-basement:9.0.0 (*) | \--- com.google.firebase:firebase-analytics-impl:9.0.0 | +--- com.google.android.gms:play-services-base:9.0.0 | | +--- com.google.android.gms:play-services-basement:9.0.0 (*) | | +--- com.google.firebase:firebase-common:9.0.0 (*) | | \--- com.google.android.gms:play-services-tasks:9.0.0 (*) | +--- com.google.android.gms:play-services-basement:9.0.0 (*) | +--- com.google.firebase:firebase-iid:9.0.0 | | +--- com.google.android.gms:play-services-basement:9.0.0 (*) | | \--- com.google.firebase:firebase-common:9.0.0 (*) | \--- com.google.firebase:firebase-common:9.0.0 (*) \--- project :common-lib (............) Runtime debugAndroidTestRuntimeClasspath - Resolved configuration for runtime for variant: debugAndroidTest +--- com.google.firebase:firebase-core:9.0.0 -> 11.6.0 | \--- com.google.firebase:firebase-analytics:11.6.0 | +--- com.google.android.gms:play-services-basement:11.6.0 | | +--- com.android.support:support-v4:25.2.0 -> 26.1.0 | | | +--- com.android.support:support-compat:26.1.0 | | | | +--- com.android.support:support-annotations:26.1.0 | | | | \--- android.arch.lifecycle:runtime:1.0.0 | | | | +--- android.arch.lifecycle:common:1.0.0 | | | | \--- android.arch.core:common:1.0.0 | | | +--- com.android.support:support-media-compat:26.1.0 | | | | +--- com.android.support:support-annotations:26.1.0 | | | | \--- com.android.support:support-compat:26.1.0 (*) | | | +--- com.android.support:support-core-utils:26.1.0 | | | | +--- com.android.support:support-annotations:26.1.0 | | | | \--- com.android.support:support-compat:26.1.0 (*) | | | +--- com.android.support:support-core-ui:26.1.0 | | | | +--- com.android.support:support-annotations:26.1.0 | | | | \--- com.android.support:support-compat:26.1.0 (*) | | | \--- com.android.support:support-fragment:26.1.0 | | | +--- com.android.support:support-compat:26.1.0 (*) | | | +--- com.android.support:support-core-ui:26.1.0 (*) | | | \--- com.android.support:support-core-utils:26.1.0 (*) | | \--- com.google.android.gms:play-services-basement-license:11.6.0 | +--- com.google.firebase:firebase-common:11.6.0 | | +--- com.google.android.gms:play-services-basement:11.6.0 (*) | | +--- com.google.android.gms:play-services-tasks:11.6.0 | | | +--- com.google.android.gms:play-services-basement:11.6.0 (*) | | | \--- com.google.android.gms:play-services-tasks-license:11.6.0 | | \--- com.google.firebase:firebase-common-license:11.6.0 | +--- com.google.firebase:firebase-analytics-impl:11.6.0 | | +--- com.google.android.gms:play-services-basement:11.6.0 (*) | | +--- com.google.firebase:firebase-iid:11.6.0 | | | +--- com.google.android.gms:play-services-basement:11.6.0 (*) | | | +--- com.google.firebase:firebase-common:11.6.0 (*) | | | +--- com.google.android.gms:play-services-tasks:11.6.0 (*) | | | \--- com.google.firebase:firebase-iid-license:11.6.0 | | +--- com.google.firebase:firebase-common:11.6.0 (*) | | +--- com.google.android.gms:play-services-tasks:11.6.0 (*) | | \--- com.google.firebase:firebase-analytics-impl-license:11.6.0 | \--- com.google.firebase:firebase-analytics-license:11.6.0 \--- project :common-lib (.............) Edited: app dependencies dependencies { implementation project(':common-lib') } common-lib dependencies dependencies { //android firebase implementation "com.google.firebase:firebase-core:$firebase_version" implementation "com.google.firebase:firebase-crash:$firebase_version" implementation "com.google.firebase:firebase-messaging:$firebase_version" implementation "com.google.firebase:firebase-ads:$firebase_version" //android support implementation "com.android.support:appcompat-v7:$support_version" implementation "com.android.support:design:$support_version" implementation "com.android.support:cardview-v7:$support_version" implementation "com.android.support:percent:$support_version" //others implementation 'com.google.code.gson:gson:2.8.0' implementation 'com.hannesdorfmann:adapterdelegates3:3.0.1' implementation 'net.danlew:android.joda:2.9.9' implementation 'org.ocpsoft.prettytime:prettytime:4.0.1.Final' implementation 'com.squareup.picasso:picasso:2.5.2' implementation 'com.github.simbiose:Encryption:2.0.1' //server implementation files('libs/xxx.jar') implementation files('libs/yyy.jar') implementation files('libs/zzz.jar') //tests testImplementation 'junit:junit:4.12' } versions: ext { firebase_version = '11.6.0' support_version = '26.1.0' } JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
It appears that, previously, you were implicitly depending on the common-lib module to export Firebase SDKs to your app module. Now that you've changed from "compile" to "implementation", you're no longer exporting those SDKs. So, what's happening now is this: the google-services plugin is adding v9.0.0 of firebase-core to your app module since it no longer sees it present in the visible classpath of your app module. You should be able to work around this by manually adding firebase-core to your app module at the correct version. Or, you can continue to export Firebase SDKs from your library module to your app module by switching to an "api" dependency instead of an "implementation" dependency.

Related questions

0 votes
    How Maven handles and determines what version of dependency will be used when multiple versions of an artifact are found?...
asked May 4, 2021 in Technology by Editorial Staff
0 votes
    can you please please let me know how can I check whether on which mode (32 or 64 bit) my java ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    can you please please let me know how can I check whether on which mode (32 or 64 bit) my java ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 28, 2022 in Education by JackTerrance
0 votes
    can you please please let me know how can I check whether on which mode (32 or 64 bit) my java ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    I want to connect android to my nao , it is version V4 or 1.14.5 and I do not find library ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 22, 2022 in Education by JackTerrance
0 votes
    02.Give some information about the following operating system with their latest version, a) Android operating ... operating system Select the correct answer from above options...
asked Dec 30, 2021 in Education by JackTerrance
0 votes
    Is it necessary to keep Spring MVC in the classpath for developing RESTful web services?...
asked Jun 24, 2021 in Technology by JackTerrance
0 votes
    I'm using Kotlin to build a web service and I stumbled upon what I consider to be a strange ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    The java project I am working on has a .bat file and a .sh file which build the CLASSPATH for ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
    The java project I am working on has a .bat file and a .sh file which build the CLASSPATH for ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    What exactly is classpath, what value does it hold ? Can you also tell me the command that can be used to set classpath ? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    How can we add stuff to the classpath when running things in groovy or groovysh?...
asked Sep 25, 2021 in Technology by JackTerrance
0 votes
    What is a classpath? What exactly is classpath, what value does it hold ? Can you also tell me the command that can be used to set classpath ?...
asked Nov 20, 2020 in Education by Editorial Staff
0 votes
    I'm working on a project which need these deep learning libraries - keras and tensorflow. Unfortunately, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    What are the different storages available in android?...
asked Jan 14, 2021 in Technology by JackTerrance
...