gradle will automatically bump up the stdlib to 1....
# announcements
m
gradle will automatically bump up the stdlib to 1.1 if necessary to keep things consistent
­čĹŹ 2
m
It will use the latest version, but will not bump automatically.
I have @nhaarman 's mockito-kotlin and I also needed to add
Copy code
androidTestCompile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
Error:Conflict with dependency 'org.jetbrains.kotlin:kotlin-stdlib' in project ':app'. Resolved versions for app (1.1.0) and test app (1.0.6) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
n
@maciej still for 1.1.0?
m
I use 1.1.
n
I have this, haven't tested without for 1.1.0:
Copy code
configurations.all {
        resolutionStrategy {
            forcedModules = [kotlinStdLib,
                             kotlinReflect]
        }
    }
where the forcemodules version is 1.1.0-eap-x
If you want to see, just remove testCompile kotlin-reflect and try to run tests.
Not that I would want you to update your lib to 1.1. Just pointing to the issue I had (easily) resolved.
Note it's Android and Android is weird.
It will create two separate APKs for app and test code and can end up having different versions of dependencies in each, then it crashes.
That's the reason behind
exclude group: ...
and adding
kotlin-reflect:1.1
.
n
@mg6maciej There are a couple of people who upvoted the pull request to update the Kotlin dependency for Mockito-Kotlin to 1.1.0, which is exactly why I'm asking ^^
m
Added a comment there.
Maybe will help someone who didn't figure it out for themselves.
n
great!
so the build definitely fails for you if your don't add those lines, right? If that's the case, perhaps the best thing to do is indeed updating the dependency to to 1.1.0
m
I think it's a safe assumption. Unless you add a lot of features people can still use 1.3.0 with Kotlin 1.0.x.
If I had to guess, more than half Android projects globally are already on 1.1.
n
yeah but that's a shame to the other half if it doesn't work, isn't it ­čśů