Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with Android dependency 'com.google.android.gms:play-services-measurement-base' #3

Closed
Purus opened this issue Dec 19, 2018 · 6 comments

Comments

@Purus
Copy link

Purus commented Dec 19, 2018

Using this plugin along with the latest version of Firebase, gives the below issue while building. I guess this is due to the version conflicts of the dependency.

Launching lib\main.dart on MotoG3 in debug mode...
Initializing gradle...
Resolving dependencies...
Gradle task 'assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:preDebugBuild'.
> Android dependency 'com.google.android.gms:play-services-measurement-base' has different version for the compile (16.0.3) and runtime (16.0.4) classpath. You should manually set the same version via DependencyResolution

* 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 1m 39s
Finished with error: Gradle task assembleDebug failed with exit code 1
@Purus
Copy link
Author

Purus commented Dec 19, 2018

Please note, I am not using firebase_admob, but the other firebase plugins..

@YoussefKababe
Copy link
Collaborator

Hi @Purus! I think this is a know issue and Google has some words about it here in their release notes: https://developers.google.com/android/guides/releases#november_13_2018

I know only a little about Gradle and Android dependency management. Can you try forcing version for that dependency to 16.0.4 or 16.0.5 and see if it solves your issue?

@gctommy
Copy link

gctommy commented Dec 19, 2018

@Purus — I'm using this plugin as well and ran into similar problems. What worked for me was updating all the firebase dependencies in my app level build.gradle to their latest and then adding all the Kotlin dependencies that were not in my project for BOTH the build.gradle and app level build.gradle

Add lines 2 and 10 from: https://github.com/YoussefKababe/admob_flutter/blob/master/example/android/build.gradle#L2
Add lines 25 and 63 from: https://github.com/YoussefKababe/admob_flutter/blob/master/example/android/app/build.gradle#L25

Also using gradle 4.6 for the distributionUrl in gradle-wrapper.properties (not sure if this one matters)

@Purus
Copy link
Author

Purus commented Dec 19, 2018

@gctommy Can you share me how you updated all firebase dependencies in the app level build.gradle file? I am new to Android..
@YoussefKababe Thanks. I am trying to find out how to update such dependencies.

@apitutinteractive
Copy link

Try
Add lines 2 and 10 from: https://github.com/YoussefKababe/admob_flutter/blob/master/example/android/build.gradle#L2
and
Add lines 25 and 63 from: https://github.com/YoussefKababe/admob_flutter/blob/master/example/android/app/build.gradle#L25

but still error

then i add this on android/build.grade, its working
subprojects {
configurations.all() {
resolutionStrategy.force "com.google.firebase:firebase-core:16.0.5"
}
}

@Purus
Copy link
Author

Purus commented Dec 19, 2018

I reverted back all the changes mentioned by @gctommy and added the code mentioned by @apitutinteractive .

And voila.. it's now working. Thanks all for the work solution. Great guys..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants