darkmoon_uk
08/19/2019, 9:55 PMThe 'java' plugin has been applied, but it is not compatible with the Android plugins.
...while trying to make an Multiplatform library with an Android and JavaFX target. The OpenJfx plugin putting a dependency on the Java application
plugin is causing it, in this file:
https://github.com/openjfx/javafx-gradle-plugin/blob/master/src/main/java/org/openjfx/gradle/tasks/ExecTask.java
This means it is not a trivial fix 😕
The crux of the issue is the way the Android Plugin refuses to execute in the presence of the java
plugin; I can see two routes to go here:
1) Make a PR vs the OpenJfx project to make the plugin it adheres to for execution more configurable.
2) Deal with the Android Plugin head on - while this seems like the more daunting task, as there may be deeper issues, @abreslav left a curious comment against a similar issue report, here:
https://discuss.kotlinlang.org/t/kotlin-android-gradle/789
"Since Andriod's Gradle is rather peculiar, we have to essentially build a separate Gradle plugin for Kotlin on Android. We are working on it, you can contribute if you feel like it."
...which suggests JB may have considered this back in '13, but the exclusion problem persists.louiscad
08/19/2019, 10:11 PMdarkmoon_uk
08/19/2019, 10:13 PMdarkmoon_uk
08/19/2019, 10:15 PMandroid-platform-tools-base/build-system/gradle/src/main/groovy/com/android/build/gradle/BasePlugin.groovy
darkmoon_uk
08/19/2019, 10:16 PMlouiscad
08/19/2019, 10:46 PMdarkmoon_uk
08/19/2019, 11:09 PMapplication
plugin so it can emplace itself as a dependency of the run
task, ensuring it gets to perform module configuration before any App compile. It should be possible to implement so that it has an affinity with 'Kotlin first' (✨), before attempting to load the Java plugin.abreslav
08/20/2019, 3:43 AMgildor
08/20/2019, 6:29 AMdarkmoon_uk
08/20/2019, 6:32 AMjava
. Practical solution for my project right now is just to do manually what the OpenJfx plugin tries to provide as a convenience: which is just to set up the right Java Modules.darkmoon_uk
08/20/2019, 6:33 AMkotlin-multiplatform
plugin, falling back to the default application
plugin where multiplatform isn't present.gildor
08/20/2019, 6:58 AMthere are probably good reasons it excludesThere is, java plugin used to build Jars, Android build and packaging process is completely differentjava
falling back to the defaultI believe plugin just shouldn’t apply application automatically, instead configure own run task if application plugin is applied to the projectplugin where multiplatform isn’t presentapplication
h0tk3y
08/20/2019, 10:12 AMapplication
plugin is applied. Perhaps a third-party plugin could replace this logic by creating this task in a similar way using the Kotlin/JVM target. This logic could then be contributed to OpenJfx.