ursus
06/24/2021, 1:59 PMursus
06/24/2021, 1:59 PMrsktash
06/26/2021, 6:46 PMmain
to mainui
it worksJavier
06/27/2021, 6:14 PMgradlew build
, it doesn't run. I tried both, register
and create
, same problem. Is it a bug or is it the expected behavior?dave08
06/29/2021, 1:51 PMVivek Modi
06/30/2021, 11:06 AMExecution failed for task ':app:kaptSelectorDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
> java.lang.reflect.InvocationTargetException (no error message)
Dylan
07/01/2021, 12:15 PMchan
07/01/2021, 7:47 PM1.4.30
Execution failed for task ':module-common:generatePomFileForMavenJavaPublication'.
> Could not apply withXml() to generated POM
> kotlin.KotlinNullPointerException (no error message)* Exception is:
Caused by: org.gradle.api.UncheckedIOException: Could not write to file '.../module-common/build/publications/mavenJava/pom-default.xml'
darkmoon_uk
07/05/2021, 12:59 AMsomeModule-jvm.jar
) in my Kotlin Multiplatform project?
Asking because I restructured my project to have submodules for Clean architecture layers, so now I have multiple JARs named e.g. domain-
, presentation-
, service-
Justin Tullgren
07/09/2021, 1:26 PMRuntime JAR files in the classpath should have the same version. These files were found in the classpath
and I can't seem to fix it even by adding the explicit versions in my project. How should this be resolved? Thanks!Francesc
07/11/2021, 1:41 AMNikiizvorski
07/13/2021, 8:30 AMzalewski.se
07/13/2021, 7:22 PMCaused by: ScriptCompilationException(errors=[ScriptCompilationError(message=Unresolved reference: libs, location=/Users/username/.gradle/.tmp/gradle-kotlin-dsl-8359750362388470244.tmp/build.gradle.kts (13:20)),
My gradle setup looks like this:
plugins {
`kotlin-dsl`
id("com.osacky.doctor") version "0.7.0"
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
implementation(libs.android.gradle)
implementation(libs.kotlin.gradle.plugin)
implementation(libs.kotlin.serialization)
implementation(libs.sqldelight.gradle.plugin)
}
kotlin {
explicitApi()
}
It works completely fine if I build it from cli. Is this some known error of AS and toml version catalog compatibility or I’m doing something wrong?
Gradle wrapper version: 7.1.1
AS: 2021.1.1 Canary 3ursus
07/17/2021, 11:11 PMconfigureEach
and register
to achieve config. avoidance
applicationVariants.configureEach { variant ->
variant.outputs.configureEach { output ->
def abi = output.getFilter(com.android.build.OutputFile.ABI)
def abiName = abi.replace("_", "").replace("-", "")
tasks.register("appAutomateUpload${abiName.capitalize()}${variant.name.capitalize()}", AppAutomateUpload) {
group = "browserstack"
...
dependsOn "assemble${variant.name.capitalize()}"
}
}
}
My question is, if only few variants-tasks are actually used, i.e. I for sure don't need all the variant tasks.
Should I
1. just do a if ( variant = "...) then return? to not generate a task for that variant at all
2. or, since this is config avoidance, it doesn't matter, since from what I understand, it will be configured lazily, meaning the unused ones won't get configured ever
Performance is what I'm afterursus
07/17/2021, 11:36 PMapplicationVariants.configureEach { variant ->
variant.outputs.configureEach { output ->
pritln "variant; output"
prints that even when running gradlew help
... so...whats the differenceursus
07/18/2021, 2:38 AMandroidComponets {
onVariants {
println "variant=$it"
}
}
why does this not compile? its eaxcly the official sample
wakingrufus
07/21/2021, 8:21 PMplugins {
id 'java-gradle-plugin'
id 'org.jetbrains.kotlin.jvm'
}
dependencies {
compileOnly gradleApi()
implementation "org.scalastyle:scalastyle_2.12:1.0.0"
testCompileOnly gradleApi()
testCompile 'junit:junit:4.13.1'
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5Version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit5Version"
testImplementation("org.junit.jupiter:junit-jupiter-params:$junit5Version")
testImplementation "org.assertj:assertj-core:$assertJVersion"
}
and i cant seem to access the project.tasks.register<TaskType>(name: String)
among other thingsDariusz Kuc
07/22/2021, 5:46 PMcompileKotlin
/`compileTestKotlin` tasks. This works great for the regular JVM builds but blows up on the Android builds as those tasks don't exist and instead we have variants (e.g. compileDebugKotlin
).
Since I'm not familiar with Android ecosystem was wondering whether anyone here got some suggestions on
• how to detect whether plugin is applied on Android project? (check for android
extension?)
• how to get all the variants? (get all tasks of compile kotlin type and then apply crude filter looking for test
in the name?)
• do I need to add generated sources to different source sets based on variants?
• anything else that I might be missing?spierce7
07/24/2021, 7:04 PMmodel
, but that doesn’t seem to exist in the kotlin world.
2. if I run ./gradlew :project:tasks
I get a list of tasks for that project. I can do something like this in gradle 6.9:
def copyDylib = tasks.register('copyDylib', Copy) {
dependsOn "assembleDependentsMyJniLibrarySharedLibrary"
from(file("$buildDir/libs/myjnilibrary/shared/"))
into(file("$resourcesPath"))
}
But after upgrading to Gradle 7.x, it can no longer find the task assembleDependentsMyJniLibrarySharedLibrary
even though I can call it and it clearly exists. I’ve also tried afterEvaluate
with the same result.andylamax
07/26/2021, 2:55 AMlintOptions {
isAbortOnError = false
}
In AGP 7.0.0-alpha01 using kotlin-dsl?
The above snipet works with AGP 4.1.3, it fails when upgraded to 7.0.0Jgafner
07/26/2021, 8:57 AMtasks.register("uiTestCore", Test) {
it.group("verification")
// we don't want to cache the results of this.
it.outputs.upToDateWhen { false }
it.systemProperty("robot-server.port", remoteRobotPort)
}
It is failing on the systemProperties and I can’t find an example
tasks.register<Test>("uiTestCore") {
group = "verification" // we don't want to cache the results of this.
outputs.upToDateWhen { false }
systemProperties("robot-server.port", remoteRobotPort)
}
any idea?Samuel Dobbie
07/26/2021, 5:10 PM# build.gradle.kts
tasks.withType<Test> {
...
environment = mapOf(
"VERSION" to "1.0",
"TYPE" to "some-type",
"NAME" to "some-name",
"PATH" to "some-path",
)
}
Whilst this works, I'm trying to remove this block and instead set these env variables in the bash script show below. The current approach of simply exporting the values doesn't seem to be making them available to the JVM.
# run-tests.sh
export VERSION=1.0
export TYPE=some-type
export NAME=some-name
export PATH=some-path
./gradlew test --tests HealthCheck
Any suggestions on how to resolve this would be much appreciated.Dariusz Kuc
07/26/2021, 9:27 PMANDROID_SDK_ROOT
(or sdk.dir
to provided) so while I can get it to work locally any suggestions on how to make it a self contained build on GH actions?Tomasz Krakowiak
07/27/2021, 5:18 PMError: Could not find or load main class org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
Caused by: java.lang.ClassNotFoundException: org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
1.5.21 gradle plugin, tried different SDKs, upgrading plugin to 1.5.30-M1, downgrading to 1.5.20, 1.5.10. Cleaning project, removing whole $HOME/.gradle directory.
This error relates to submodule of multi-project project. Modules use either jvm or mpp plugin.
Thread in Slack ConversationDariusz Kuc
07/27/2021, 5:23 PMcompileKotlin
in JVM builds and compile${Variant}Kotlin
for 🤖 ). What is somewhat weird is that for JVM builds my task gets included when running build
goal but on Android it is not....
If I explicitly run my task on Android project it does get finalized correctly. So just wondering what would be the cause of the difference in behavior between JVM and Android buildskevindmoore
07/28/2021, 10:14 PMjvm {} or jvm("desktop")
in the kotlin section. I am also having problems with a sourceset including another projecteygraber
07/30/2021, 8:30 PMcompile*Kotlin
tasks have build cache misses (specifically for Android projects building a release variant) even though nothing apparent changed in those modules.
What's the best way to debug this?eygraber
07/30/2021, 9:59 PMkotlin.daemon.jvm.options
to 12g and now I'm intermittently getting this warning multiple times in my builds (and my builds are going apprx 3-4x slower). The build still completes successfully:
Could not connect to Kotlin compile daemon
Could not connect to kotlin daemon. Using fallback strategy.
Christopher Elías
07/31/2021, 4:57 PMNorbi
08/01/2021, 4:35 PMincludeBuild()
. I'm using Android Studio Arctic Fox 2020.3.1.
When I build it in Idea it seems to succeed, classes referenced from the included build are resolved as well.
But in the editors these references remain "red", they cannot be resolved by the editors.
Do you have any suggestion how I should investigate the root of the problem?