tylerwilson
02/08/2021, 8:58 PMPlugin request for plugin already on the classpath must not include a versionthe plugins like is like so:
id("org.jetbrains.kotlin.multiplatform") version "1.4.21"
So I need that version to work from iOS (which appears to go through the settings.gradle.kts resolutionStrategy eachPlugin block), but AS does not like it.
Anybody have a solution handy?Vampire
02/08/2021, 9:10 PMtapchicoma
02/08/2021, 9:38 PMsettings.gradle.kts
: https://docs.gradle.org/current/dsl/org.gradle.plugin.use.PluginDependenciesSpec.html#N1B7C1
Then in build files you just use required plugin without versiontylerwilson
02/08/2021, 10:09 PMplugins {
kotlin("multiplatform") version "1.4.21" apply false
}
and the call from Xcode does not give me an error about finding the plugin. But now gives me an error in the kotlin { android() … } line.
Showing All Messages
com/android/build/gradle/BaseExtension
Should writing build files be harder than the app itself, I wonder to myself. 🙂Vampire
02/08/2021, 10:18 PMtylerwilson
02/08/2021, 10:21 PMtylerwilson
02/08/2021, 10:21 PMtylerwilson
02/08/2021, 10:22 PMVampire
02/08/2021, 10:29 PMPlugin request for plugin already on the classpath must not include a version
but Cannot add a configuration with name 'androidTestApi' as a configuration with that name already exists.
tylerwilson
02/08/2021, 10:33 PMtylerwilson
02/08/2021, 10:33 PMtylerwilson
02/08/2021, 10:34 PMtylerwilson
02/08/2021, 10:34 PMtylerwilson
02/08/2021, 10:34 PMShowing All Messages
Plugin [id: 'com.android.library', artifact: 'com.android.tools.build:gradle:null'] was not found in any of the following sources:
tylerwilson
02/08/2021, 10:35 PMtylerwilson
02/08/2021, 10:35 PMShowing All Messages
Plugin [id: 'org.jetbrains.kotlin.multiplatform', version: '1.4.21'] was not found in any of the following sources:
tylerwilson
02/08/2021, 10:37 PMVampire
02/08/2021, 11:16 PMpluginResolution
block.
But that is probably not really related to your question.
With what you have shown last, I get Plugin [id: 'com.android.library', artifact: 'com.android.tools.build:gradle:null'] was not found in any of the following sources:
which is totally clear, because you apply the plugin without defining any version anywhere, neither where you apply the plugin, nor where you do the id-to-artifact mapping or where you could define default plugin versions for the whole build.tylerwilson
02/09/2021, 12:00 AMplugins {
id("com.android.library")
kotlin("multiplatform")
kotlin("plugin.serialization") version "1.4.21"
kotlin("native.cocoapods")
id("com.chromaticnoise.multiplatform-swiftpackage") version "2.0.3"
}
and settings.gradle.kts:
pluginManagement {
repositories {
google()
jcenter()
mavenCentral()
maven(url = "<https://kotlin.bintray.com/kotlinx/>")
}
resolutionStrategy {
eachPlugin {
if (requested.id.namespace == "com.android") {
useModule("com.android.tools.build:gradle:4.1.2")
}
when (requested.id.id) {
"kotlin-multiplatform", "org.jetbrains.kotlin.multiplatform", "org.jetbrains.kotlin.native.cocoapods" -> useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21") //$kotlinVersion")
"kotlinx-serialization", "org.jetbrains.kotlin.plugin.serialization" -> useModule("org.jetbrains.kotlin:kotlin-serialization:1.4.21") //$kotlinVersion")
}
}
}
}
thank you for the input.tylerwilson
02/09/2021, 12:01 AMVampire
02/09/2021, 12:34 AMtylerwilson
02/09/2021, 12:45 AM