0

I try to add google map to my flutter app using the map_view plugin. But when I try to build the app I have this error :

*FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:preDebugBuild'.

Android dependency 'com.android.support:support-fragment' has different version for the compile (26.1.0) and runtime (27.1.1) classpath. You should manually set the same version via DependencyResolution*

I follow all instructions in the plugin installation guide, and also generate an API key in the google console for Map android SDK. I added all information in the manifest file : - 2 lines for permissions - 2 lines with metada including one with the API key generated just before on google console - 1 line for activity

I try to build without adding any code regarding the map, normaly I believe that it should work, I mean I configure it but don't import the map in my code, just try to build.

Does anyone have an idea about how to fix that ?

Jo-zTk
  • 95
  • 7
  • Looks like a dup of https://stackoverflow.com/questions/44653261/android-dependency-has-different-version-for-the-compile-and-runtime – Günter Zöchbauer Sep 23 '18 at 14:48
  • Thank for your answer, I came from JS to flutter without any background in android App. But I didn't find any of my files with dependancies using implementation, maybe it's different with flutter – Jo-zTk Sep 23 '18 at 15:15
  • It's fine, no worries. Please try the suggestion from the linked question and report back about your progress or new errors. – Günter Zöchbauer Sep 23 '18 at 15:17
  • I tried your suggestion but in fact I can't find anywhere in my project something that I can replace with 'API' instead of 'Implementation' or 'compile'.. In my flutter project the only thing I had for dependencies is in my /Android/build.gradle : `dependencies { classpath 'com.android.tools.build:gradle:3.1.2' classpath 'com.google.gms:google-services:3.2.1' classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-4' }` I tried to replace classpath with 'api' but build still failed. – Jo-zTk Sep 23 '18 at 16:18
  • 1
    Well, thank you Günter, i found where to modify it, it is in 'External libraries'. I was trying in VSC instead of Android studio. Now I can build without errors. 'External libraries' was not displayed in VSC. Many thank – Jo-zTk Sep 23 '18 at 16:37

0 Answers0