Skip to content

Instantly share code, notes, and snippets.

@hvisser
Created December 15, 2018 00:34
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save hvisser/b027af96f9c57f94cf430bbdae236da9 to your computer and use it in GitHub Desktop.
Save hvisser/b027af96f9c57f94cf430bbdae236da9 to your computer and use it in GitHub Desktop.
Fix up kotlin plugin version + runtime for Flutter plugins
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0-rc01'
}
// Set a resolution strategy on the subprojects buildscript classpath
// Not sure if there's a more elegant way to do this
for (p in project.subprojects) {
p.buildscript.configurations.classpath.resolutionStrategy {
force 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.11'
}
}
}
allprojects {
repositories {
google()
jcenter()
}
configurations.all {
resolutionStrategy {
dependencySubstitution {
// Replace the Kotlin old runtime with the new coordinates
// Depending on your project more tweaks to the resolution strategy may be needed
substitute module('org.jetbrains.kotlin:kotlin-stdlib-jre7') with module('org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.11')
}
}
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
@sc4v3ng3r
Copy link

thank you. This helps a lot.

@von-maurus
Copy link

von-maurus commented Feb 13, 2019

I cant get it to work. Im working with build gradle version 3.2.1. Maybe thats the problem?
map_view version is 0.0.14
Error: * What went wrong:
Execution failed for task ':app:preDebugBuild'.

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

@soofi-cheenilabs
Copy link

Thanks!
Helped me a lot!
But will this affect running other plugins and apps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment