Gunslingor
04/06/2020, 8:33 PMfun android(
name: String = "android",
configure: KotlinAndroidTarget.() -> Unit = { }
): KotlinAndroidTarget =
configureOrCreate(
name,
presets.getByName("android") as KotlinAndroidTargetPreset,
configure
)
russhwolf
04/06/2020, 8:50 PMcom.android.library
plugin, add a top-level android{}
block with sdk version config, add a manifest file.Gunslingor
04/06/2020, 8:50 PMplugins {
java
id("com.android.application")
kotlin("android")
kotlin("multiplatform") version "1.3.71"
}
russhwolf
04/06/2020, 8:50 PMGunslingor
04/06/2020, 8:51 PMrepositories {
mavenCentral()
jcenter()
jcenter {
url = uri("<https://kotlin.bintray.com/kotlin-js-wrappers>")
}
maven {
url = uri("<https://jitpack.io>")
}
google()
}
russhwolf
04/06/2020, 8:52 PMbuildSrc
of a parent build.gradle, or in pluginManagement
of settings.gradleGunslingor
04/06/2020, 8:53 PMrusshwolf
04/06/2020, 9:04 PMGunslingor
04/06/2020, 9:04 PMrusshwolf
04/06/2020, 9:07 PMGunslingor
04/06/2020, 9:10 PMrusshwolf
04/06/2020, 9:12 PMGunslingor
04/06/2020, 9:12 PMrusshwolf
04/06/2020, 9:13 PMGunslingor
04/06/2020, 9:14 PMrusshwolf
04/06/2020, 9:25 PMSebastien Leclerc Lavallee
04/07/2020, 12:12 AMGunslingor
04/07/2020, 12:13 AMSebastien Leclerc Lavallee
04/07/2020, 12:14 AMGunslingor
04/07/2020, 12:18 AMSebastien Leclerc Lavallee
04/07/2020, 12:24 AMGunslingor
04/07/2020, 12:37 AMSebastien Leclerc Lavallee
04/07/2020, 12:44 AMGunslingor
04/07/2020, 12:48 AMSebastien Leclerc Lavallee
04/07/2020, 12:53 AMGunslingor
04/07/2020, 1:03 AMSebastien Leclerc Lavallee
04/07/2020, 1:08 AMGunslingor
04/07/2020, 1:10 AMSebastien Leclerc Lavallee
04/07/2020, 1:11 AMGunslingor
04/07/2020, 4:36 AMSebastien Leclerc Lavallee
04/07/2020, 1:59 PMbuild.gradle.kts
and I think it’s not where you want to add implementation
Gunslingor
04/07/2020, 4:26 PMplugins {
id("com.android.application")
kotlin("android")
kotlin("android.extensions")
}
After doing all that the below screenshot is what I ended up with... everything looks pretty solid to me except the app build file disappeared, something automatically deleted it... will try to add that back now.
Okay, I added the example gradle app build file to my project, I know it won't work but I am just testing the plug black because that's what is causing this. first thing I noticed is the:
id("com.android.application")
seems to be importing ok, which is great it wasn't before. But it keeps failing on this common error I saw before implying the android and, as previously, android-extensions is failing to download:
Plugin [id: 'org.jetbrains.kotlin.android'] was not found in any of the following sources:
And yet, I have app and shared tasks in my gradle ingtellij plugin, but only when I remove the app gradle file with nothing but... yeah, okay, app everything works when the app file has nothing but
plugins {
id("com.android.application")
}
But fails when it has:
plugins {
id("com.android.application")
kotlin("android")
}
https://files.slack.com/files-pri/T09229ZC6-F011G7VLQ6M/image.png▾
https://files.slack.com/files-pri/T09229ZC6-F01197SQCN6/image.png▾
Sebastien Leclerc Lavallee
04/07/2020, 6:03 PMGunslingor
04/07/2020, 6:07 PMSebastien Leclerc Lavallee
04/07/2020, 6:20 PMGunslingor
04/07/2020, 6:28 PMSebastien Leclerc Lavallee
04/07/2020, 6:32 PMactual
declarationsGunslingor
04/07/2020, 6:34 PM