I've migrate over to Gradle's new `plugins` system...
# android
k
I've migrate over to Gradle's new
plugins
system and for some reason the Android plugin needs me to add
Copy code
pluginManagement {
    repositories {
        gradlePluginPortal()
        jcenter()
        google()
    }
    resolutionStrategy {
        eachPlugin {
            if (requested.id.id.startsWith("com.android")) {
                useModule("com.android.tools.build:gradle:${requested.version}")
            }
        }
    }
}
to my
settings.gradle
file
a
yeah it’s because they don’t publish to the gradle plugins portal, if you’re not using it on your top level gradle file you can still use the classpath way.
g
It explained in the official doc, and Android plugin mentioned as an example: https://docs.gradle.org/current/userguide/kotlin_dsl.html#sec:plugins_resolution_strategy
it’s still looks very strange for me, that after all years and reported issues about it there is no solution
a
oh yeah, it’d be nice if they published it correctly
g
They at least could publish plugin marker to their own google repo, it’s just a simple text file, so it would allow to get rid of
resolutionStrategy
, only custom repo would be required
Copy code
pluginManagement {
    repositories {
        google()
    }
}
i
You make it sounds like easy fix.
g
publish plugin marker is for sure easy, technically and I don’t see any legal problems
But publishing to Gradle Plugins Portal probably not so easy, not technically, but legally Google doesn’t publish to maven/jcenter, only to own repo
k
Ya I get not publishing to a "non-google" repo but having to have the resolution strategy seems fixable.
Thanks for the answers btw