André Martins
03/25/2022, 10:34 AMOla Adolfsson
03/27/2022, 2:36 PMFrancesc
03/28/2022, 8:07 PMandroid
is not defined. Looks like I'm missing some dependencies possibly, does anybody have an example to follow or some hints on what the issue might be? Details in thread.Francesc
03/28/2022, 8:26 PMbuildSrc/build.gradle.kts
? Details in threadMarc Knaup
04/03/2022, 9:20 PMwithConvention
?Marc Knaup
04/03/2022, 9:28 PMLanguage version 1.4 is deprecated and its support will be removed in a future version of Kotlin
Rachel Carandang
04/04/2022, 7:22 PMobject Scopes {
fun serial(): CoroutineScope = CoroutineScope(...)
}
In the consumer app of the library, I’m getting this new error:
Scopes.serial() -> Unresolved reference: serial
Java 8 Bytecode from consumer app:
public final class Scopes {
@NotNull
public static final Scopes INSTANCE = new Scopes();
However, I call Scopes.INSTANCE.serial() it works.
Additionally, I’m getting errors with accessor properties in interfaces not being recognized in the consumer app, even though the decompiled java bytecode says it’s there.
Is there an additional compiler configuration I’m missing?Jeff Tycz
04/07/2022, 12:11 AMlintPublish
to the androidMain
dependencies like this
val androidMain by getting {
dependencies {
lintPublish(project(":lint"))
implementation("androidx.core:core-ktx:1.7.0")
implementation("io.ktor:ktor-client-android:1.6.7")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0")
}
}
but the kotlin dsl does not recognize lintPublish
. The exact error is
Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:What am I doing wrong, do I place the lintPublish somewhere else? Does KMM work with custom lint checks?
André Martins
04/07/2022, 4:15 PMJerv Norsk
04/08/2022, 9:31 AMplugins {
kotlin("multiplatform")
application
}
application {
mainClass.set("io.github.jervnorsk.aden.server.Main")
}
kotlin {
jvm {
testRuns["test"].executionTask.configure {
useJUnitPlatform()
testLogging {
events = setOf(
org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED,
org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED
)
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
showExceptions = true
showStandardStreams = true
}
}
}
sourceSets {
val commonMain by getting {
dependencies {}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting {
dependencies {
implementation("io.ktor:ktor-server-core:${extra["ktor.version"]}")
implementation("io.ktor:ktor-server-netty:${extra["ktor.version"]}")
implementation("ch.qos.logback:logback-classic:1.2.5")
}
}
}
}
Łukasz Gendek
04/11/2022, 8:24 AMcompileKotlin {
kotlinOptions {
jvmTarget = "14"
allWarningsAsErrors = true
freeCompilerArgs += [
"-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlinx.coroutines.ObsoleteCoroutinesApi"]
}
}
However since kotlin 1.6.0 the -Xopt-in flag shoud be replaced with -opt-in. The problem is that I often switch kotlin version (and then I remove/add the X character). Is there a way to have one gradle file that works for both kotlin 1.5 and kotlin 1.6?darkmoon_uk
04/12/2022, 9:13 AM1.6.10
to 1.6.20
causes this StackOverflowError
when Gradle syncing the project.
Same result on Gradle 7.4.2
and 7.4.1
ursus
04/12/2022, 7:25 PMhfhbd
04/13/2022, 12:36 PMKotlinPlatformJvmPlugin
, which works, but I am getting a deprecated info. What is the updated plugin class?janvladimirmostert
04/17/2022, 2:47 PMgradle.properties
(like coroutinesVersion=1.6.1 or kotlinVersion=1.6.20) and then inside build.gradle.kts access it somehow?
plugins {
kotlin("multiplatform").version(kotlinVersion).apply(false)
val commonMain by getting {
dependencies {
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
Alternatively, what is the consensus on using version catalogues (define a catalogue in the root and then keep all the module depenendency versions in sync like this)
https://docs.gradle.org/current/userguide/platforms.htmlmyanmarking
04/20/2022, 10:09 AMjannis
04/20/2022, 1:51 PMUnresolved reference: versionCatalogs
However everything works fine besides this error. I can build my (android) app without any other problems. The CLI never reports this error. Someone has an idea how to solve this?
This is my settings.gradle.kts
file within the composite build:
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
I'm using the latest stable Gradle Version (7.4.2)nuhkoca
04/20/2022, 1:52 PMjacoco-report-aggregation
for Android projects. Google around a bit and check Gradle
documentation but couldn’t adapt it for my project. Can somebody shed some light on this? Thank you!martmists
04/20/2022, 8:26 PMjanvladimirmostert
04/20/2022, 10:06 PMdependencyResolutionManagement {
versionCatalogs {
create("blah") {
val coroutinesVersion = "1.6.1"
library("kotlinx-coroutines-core", "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
library("kotlinx-coroutines-jdk8", "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$coroutinesVersion")
and inside ProjectA, any module that needs coroutines, just implement(blah.kotlinx.coroutines.core)
now ProjectB's settings.gradle.kts contains
// blah
includeBuild("../blah-framework")
and I can include modules like this:
implementation("io.blah:blah-module-1")
implementation("io.blah:blah-module-2")
Now in projectB, I want to include coroutines but I want to lock the version to whatever the version is in blah-framework
and just include it
implementation(blah.kotlinx.coroutines.core)
is this possible with versionCatalogs?James Eschner
04/21/2022, 2:54 PMassemble
task, it appears that the code compiles successfully, but then as a very last step IntelliJ fails with “Invalid value: -1".
Kotlin version: 1.6.20
Gradle version: 7.4.2
I don’t have any issues running the assemble
task from the command line, so I know it is something to do with IntelliJ.
Anyone else seeing this?
** Not a contributionAyfri
04/21/2022, 4:12 PMpublishToSonatype
, here's my workflow file and here's the result
I'm just trying to publish all my modules to sonatype at once using a github action and it's very very hard.
When using ./gradlew tasks
the task is theremartmists
04/24/2022, 10:31 PMMarc Knaup
04/25/2022, 11:27 AMtseisel
04/27/2022, 6:20 PMMuhammad Talha
04/28/2022, 8:29 AMExpression 'jar' cannot be invoked as a function. The function 'invoke()' is not found
. I already added the java
plugin in the plugins
function. Would any one be able to provide some guidance? Thanks!
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.6.21"
java
application
}
group = "me.talha"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
testImplementation(kotlin("test"))
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "11"
}
application {
mainClass.set("MainKt")
}
jar {
manifest {
attributes 'Main-Class': 'MainKt'
}
}
Ayfri
04/29/2022, 3:22 PMbuildSrc
and version catalogs ?maarten ha
04/29/2022, 4:51 PMDilraj Singh
04/29/2022, 7:55 PMonVariants
API, but it is not working, throwing groovy.lang.MissingMethodException
. The below snippet contains the code which I have added to my app/build.gradle
-
plugins {
//...
}
android {
//...
}
androidComponents {
onVariants { variant ->
}
}
nkiesel
05/03/2022, 9:12 AMplugins { id "org.jetbrains.kotlin.jvm" version "1.6.0" }
to plugins { id "org.jetbrains.kotlin.jvm" version "1.6.21" }
I now get: "DefaultTaskContainer#register(String, Class, Object...) on task set cannot be executed in the current context." This is with Gradle 6.9.2. Any idea what I'm doing wrong?